SELECT COALESCE() on multiple arguments spanning different tables with an OUTER JOIN on Kudu tables is not properly being applied. This behavior is
- different relative to Kudu tables in 2.9
- different relative to the 2.10 behavior with HDFS, seemingly making this Kudu-specific
- different from Postgres, which matches the HDFS behavior, further making this seem Kudu-specific
Consider this query:
Some of the rows returned include:
The COALESCE() column is not returning the value of p_size when its first argument, n_nationkey is NULL. tpch_kudu.nation n_nationkey has values between 0 and 24, hence the NULL values in that column when part.p_size is greater.
This goes away if you keep the query above but switch the ordering of the COALESCE() arguments.
I can see the same sort of problems if I write similar RIGHT or FULL OUTER JOIN queries:
Explain-level 2 plans and profiles will be attached.