marvelshan commented on code in PR #4580:
URL: https://github.com/apache/datafusion-comet/pull/4580#discussion_r3354222718


##########
spark/src/test/resources/sql-tests/expressions/array/size.sql:
##########
@@ -21,7 +21,7 @@ CREATE TABLE test_size(arr array<int>, m map<string, int>) 
USING parquet
 statement
 INSERT INTO test_size VALUES (array(1, 2, 3), map('a', 1, 'b', 2)), (array(), 
map()), (NULL, NULL)
 
-query spark_answer_only
+query
 SELECT size(arr), size(m) FROM test_size

Review Comment:
   Done — all three items added:
   
   1. **Literal map cases**: `size(map(...))` queries added (0b3c4511). Those 
going through `CreateMap` use `spark_answer_only` since Comet has no 
`CreateMap` serde yet; `cast(NULL as map)` uses default mode as `CometLiteral` 
supports null MapType.
   2. **Cardinality alias**: `SELECT cardinality(arr), cardinality(m) FROM 
test_size` added (0b3c4511) — Spark registers it as `Size` in 
`FunctionRegistry`, so it goes through `CometSize` automatically.
   3. **sizeOfNull=false**: New `size_legacy_off.sql` with `-- Config: 
spark.sql.legacy.sizeOfNull=false` covering column-based, literal null, and 
cardinality queries under non-legacy semantics (0b3c4511).
   
   ScalarValue::Map unit tests also added per review (ff01bbc4), and stale docs 
notes cleared (b1d177ac).
   
   Should I file a follow-up issue for `CreateMap`/`MapType` literal support so 
the literal map queries can be promoted to native execution later?



-- 
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