voonhous opened a new issue, #21083: URL: https://github.com/apache/hudi/issues/21083
### Describe the problem `HoodieFileIndex#convertFilterForTimestampKeyGenerator` rewrites the string literals of partition filters when the table uses `TimestampBasedKeyGenerator` with different input and output date formats. Every rewritten literal is built as `Literal(..., StringType)`, so on Spark 4 a literal of a collated string type loses its collation. A comparison takes its collation from its left operand. With the literal on the left, for ex `'2021-jan-01' COLLATE UTF8_LCASE = dt`, the rewritten filter compares by bytes in `SparkHoodieTableFileIndex#prunePartitionPaths` and drops partitions that match under the collation (`2021-Jan-01`). ### Expected behavior The rewrite keeps the literal's data type, so partition pruning evaluates the filter under the same collation as Spark does. ### Notes Latent: it needs Spark 4, a timestamp-based key generator whose output format holds text (for ex `MMM`), and an explicit `COLLATE` on the literal side. Same class of bug as #21063. The fix is to build the converted literal with the incoming `dataType` instead of `StringType`. -- 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]
