david-mollitor-db commented on PR #58663:
URL: https://github.com/apache/spark/pull/58663#issuecomment-5623767473
The failing `CollationSQLRegexpSuite` case here ("Like simplification should
work with collated strings", the `a%c` rows) is not a flake — it's a direct
consequence of this PR's change. The new `startsAndEndsWith` gate uses
`CollapseProject.isCheap(input)`, but `isCheap` does not recognize the
`Collate` expression, so `collate(col) LIKE 'a%c'` is left as a plain `Like`
instead of simplifying to `And`.
`Collate` is a zero-cost passthrough (its `eval`/codegen delegate to the
child; the collation argument is never evaluated — it only re-tags the
collation on the type), so it is genuinely as cheap to duplicate as the child
it wraps.
I've opened **#58712**
([SPARK-59413](https://issues.apache.org/jira/browse/SPARK-59413)) to fix that
at the source: teach `CollapseProject.isCheap` to look through `Collate` to its
value child.
**#58712 is a prerequisite for this PR.** Once it merges and this branch is
rebased on `master`, the collated `a%c` rewrite returns and
`CollationSQLRegexpSuite` passes with no change here — so this PR intentionally
leaves that test unchanged.
--
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]