vigneshsiva11 opened a new pull request, #3278: URL: https://github.com/apache/datafusion-comet/pull/3278
## Which issue does this PR close? Closes #3255 ## Rationale for this change When reading Iceberg tables, timestamp columns may be dictionary-encoded in the underlying Parquet files. In the current implementation of `datediff`, scalar and array arguments can be converted into arrays of different lengths, which leads to a runtime error: > Cannot perform binary operation on arrays of different length This behavior differs from Spark, which correctly broadcasts scalar inputs and handles dictionary-backed columns without error. This change ensures Comet’s `datediff` implementation aligns with Spark semantics and avoids execution failures. ## What changes are included in this PR? - Ensure both `datediff` arguments are converted into arrays of the same length by correctly broadcasting scalars - Normalize dictionary-backed inputs to `Date32Array` before applying the binary operation - Prevent array length mismatches during vectorized execution ## How are these changes tested? - Existing unit tests in `datafusion-comet-spark-expr` were run locally - Manual verification using Iceberg timestamp columns with `to_date` and `datediff` - Verified that operations succeed when Comet is enabled and match Spark behavior -- 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]
