Indian-boult opened a new issue, #20382:
URL: https://github.com/apache/pinot/issues/20382

   With null handling on, `WHERE x IN (SELECT y FROM t2 ...)` fails in the 
multi-stage engine as soon as the subquery returns a null. The default planner 
runs a single key semi join over a leaf stage as a dynamic broadcast join, so 
this is the normal path for IN subqueries. The physical optimizer and lite mode 
return the right rows.
   
   With `int_col` values 1, 2, 3 and two nulls, one of them in group x
   
       SET enableNullHandling=true;
       SELECT int_col FROM tbl WHERE int_col IN (SELECT int_col FROM tbl WHERE 
group_col = 'x')
   
   should return 1 and 3. On master it fails with
   
       Cannot invoke "java.lang.Integer.intValue()" because 
"java.util.List.get(int)[colIdx]" is null
   
   LONG, FLOAT and DOUBLE keys fail the same way while unboxing. STRING, 
BIG_DECIMAL and BYTES keys fail in `Arrays.sort` with `Cannot invoke 
"java.lang.Comparable.compareTo(Object)" because "a[runHi]" is null`.
   
   The dynamic broadcast join turns the right side keys into an IN filter on 
the left leaf stage through `ServerPlanRequestUtils.attachDynamicFilter`. 
`computeInOperands` copies the keys into a primitive or object array and sorts 
it, and it does not expect a null key.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to