You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LogicalTypes.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -376,7 +376,7 @@ The names of the fields in the annotated Group are not important, but as a conve
376
376
#### Nullability
377
377
- If the union is not nullable then exactly one field is non-null and the field containing the union is required.
378
378
```
379
-
// Union<String, Integer, Boolean>
379
+
// Union<String, Integer, Boolean> (where the value of the union is not null)
380
380
// (exactly one of either String, Integer or Boolean is non-null)
381
381
required group my_union (UNION) {
382
382
optional binary string (UTF8);
@@ -389,18 +389,18 @@ it just contains a value that was not read from disk.
389
389
390
390
- If the union is nullable then at most one field is non-null and the field containing the union is optional
391
391
```
392
-
// Optional<Union<String, Integer, Boolean>>
393
-
// (at most one of either String, Integer or Boolean is non-null
394
-
// if they are all null then the field my_union itself must be null)
392
+
// Union<String, Integer, Boolean> (where the value of the union may be null)
393
+
// at most one of either String, Integer or Boolean is non-null
394
+
// if they are all null then the field my_union itself must be null
395
395
optional group my_union (UNION) {
396
396
optional binary string (UTF8);
397
397
optional int32 integer;
398
398
optional boolean bool;
399
399
}
400
400
```
401
-
The union field is used to differentiate a null value (the field was null to start with) from a projection that excludes the non-null field.
402
-
If the Union field is null then the value was null.
403
-
If the Union field is non-nullthen the value is non-null but was not read from disk.
401
+
The definition level of the UNION group is used to differentiate a null value (the union was null to start with) from a projection that excludes the non-null field.
402
+
If the Union group is null then the value was null.
403
+
If the Union group is non-null, but all of the options within it are null, then the value was non-null but was an option that was not projected.
404
404
405
405
- If - despite the spec - a group instance contains more than one non-null field the behavior is undefined and may change depending on the projection applied.
0 commit comments