Skip to content

Commit f852499

Browse files
committed
clarified based on feedback
1 parent 352aded commit f852499

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

LogicalTypes.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ The names of the fields in the annotated Group are not important, but as a conve
376376
#### Nullability
377377
- If the union is not nullable then exactly one field is non-null and the field containing the union is required.
378378
```
379-
// Union<String, Integer, Boolean>
379+
// Union<String, Integer, Boolean> (where the value of the union is not null)
380380
// (exactly one of either String, Integer or Boolean is non-null)
381381
required group my_union (UNION) {
382382
optional binary string (UTF8);
@@ -389,18 +389,18 @@ it just contains a value that was not read from disk.
389389

390390
- If the union is nullable then at most one field is non-null and the field containing the union is optional
391391
```
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
395395
optional group my_union (UNION) {
396396
optional binary string (UTF8);
397397
optional int32 integer;
398398
optional boolean bool;
399399
}
400400
```
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-null then 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.
404404

405405
- 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.
406406

0 commit comments

Comments
 (0)