comphead commented on PR #5452:
URL:
https://github.com/apache/datafusion-comet/pull/5452#issuecomment-5442167161
| Query | Was | Fix |
|---|---|---|
| **4** `array(named_struct('a',1), named_struct('a',id))` | native crash
"mixed length" | `CreateNamedStruct` returns a scalar struct so `make_array`
broadcasts it |
| **5** `array_insert(array(map(1,coalesce(id,0))), 2,
map(2,coalesce(id,0)))` | native "Type mismatch" | serde casts source + item to
a common deeply-nullable element type |
| **3** `array_contains(map_values(element_at(map(1,map(1,DOUBLE 0)),id)),
-0.0)` | wrong answer (bitwise `-0.0≠+0.0`) | float element types route through
codegen dispatch (Spark-exact) |
| **1** `element_at(element_at(map(1,map(0,7)),id), id%(id-2))` ANSI on |
native throws `2%0`; Spark returns NULL | `CASE WHEN left IS NOT NULL`
short-circuit under ANSI |
All four are now intended to pass with native acceleration. Not yet
compiled/run on the JVM side.
## Followup
- **Query 2** `element_at(array(0), id-2)` (ANSI off) — the only one that
already passed; test not yet added. Needs a home: safe choice is
`CometArrayExpressionSuite` (folding on). A plain SQL-file `query`
might also work, but only after confirming the "literal `element_at` +
constant-folding-off" Spark codegen bug does not fire with a per-row column
index. One quick run decides it.
- **Query 1** — fix committed but riskiest: it changes plan shape for
*every* ANSI `element_at` over a nullable map/array, and the reviewer initially
rejected it before the `left.nullable` gate. Validate
with the ANSI suites + `CometPlanStabilitySuite`, and consider splitting
into its own PR.
--
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]