daijy commented on PR #55257:
URL: https://github.com/apache/spark/pull/55257#issuecomment-4347662136
Actually there's one issue introduced in the patch. to_date could also
truncate a string, so the filter condition is not equivalent after the rule.
Here is the reproduction:
```
CREATE EXTERNAL TABLE jidai_dev.to_date_test (
device_first_linked STRING
)
USING parquet
LOCATION 'gs://roku-dea-dev/dev/jidai/to_date_test';
insert into jidai_dev.to_date_test values ('2026-04-16 08:00:00');
SELECT device_first_linked FROM jidai_dev.to_date_test WHERE
to_date(device_first_linked) = '2026-04-16'; -- return empty
```
After the UnwrapCastInBinaryComparison:
```
to_date(device_first_linked) = date'2026-04-16'
=>
device_first_linked = cast(date'2026-04-16' as string)
```
--
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]