Smallfu666 opened a new pull request, #6585: URL: https://github.com/apache/datafusion-comet/pull/6585
## Which issue does this PR close? Fixes #6584. ## Rationale for this change `CometLiteral.hasDuplicateMapKeys` keeps a folded map with a null key on Spark, but it returned early for a map with fewer than two keys, so a single-entry map skipped the null check. It was rebuilt as `CreateMap(Literal(null), v)` and failed with `NULL_MAP_KEY` where Spark returns NULL. ## What changes are included in this PR? The null check now runs before the size fast path. ## How are these changes tested? A regression test in `CometMapExpressionSuite`. It needs `ConstantFolding` to fold the cast into a literal, which the SQL file tests turn off, so it sits next to the other folded map literal tests. It fails on `main` with `NULL_MAP_KEY`. `CometMapExpressionSuite` and `CometArrayExpressionSuite` pass on Spark 4.1. -- 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]
