Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
SetOp overrides `deriveRowType()` and computes the output row type to be the least restrictive across all inputs here.
So for example given
Input 1: (I64, I64, I64?, I64?) Input 2: (I64, I64?, I64, I64?)
where ? denotes nullable, the least restrictive output computes:
Output: (I64, I64?, I64?, I64?)
For UNION operations, these nullabilities are accurate.
However for MINUS and INTERSECT there is room for improvement.
MINUS only returns rows from the first input, as such its output nullability should always match that of its first input:
Output: (I64, I64, I64?, I64?)
INTERSECT only returns rows that match across all inputs. If a column is not nullable in any of the inputs, then it is not nullable in the output because no rows can be emitted in which that column is null:
Output: (I64, I64, I64, I64?)
Attachments
Issue Links
- links to