stantheman0128 opened a new pull request, #5302:
URL: https://github.com/apache/datafusion-comet/pull/5302

   ## Which issue does this PR close?
   
   Closes #4489.
   
   ## Rationale for this change
   
   `CometCast.isSupported` matches string casts against `DataTypes.StringType`, 
the singleton default-collation instance. A non-default-collation `StringType` 
(e.g. `STRING COLLATE UTF8_LCASE`) does not match that pattern under Scala's 
equality semantics, so the cast falls through to the `unsupported(...)` 
catch-all and Comet correctly falls back to Spark. That behavior is correct 
today, but it was implicit: there was no `isStringCollationType` guard like the 
other string-touching serdes use (`arrays.scala::CometArrayIntersect`, 
`QueryPlanSerde::supportedScalarSortElementType`), and nothing pinned it down 
with a test. If a future refactor of `StringType.equals` changed that match, 
Comet could silently route collated-string casts through the native path and 
produce wrong results for collation-aware comparisons, aggregations, or hashing.
   
   ## What changes are included in this PR?
   
   Adds `CometCastCollatedStringSuite` under `spark/src/test/spark-4.x`. It 
asserts `isSupported` returns `Unsupported` for collated-string casts, in both 
directions and between two different collations, across `LEGACY`/`TRY`/`ANSI` 
eval modes. It also adds two `Compatible()` baselines showing that an identity 
cast between two instances of the same collation is a correct no-op, not the 
gap this issue describes. Registers the new suite in `pr_build_linux.yml` and 
`pr_build_macos.yml` so it runs in CI.
   
   ## How are these changes tested?
   
   This PR only adds a test suite; no production code changed. All 7 tests pass 
under `mvn test -Pspark-4.1` in WSL, and `mvn spotless:check` also passes.
   


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