-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite LIKE patterns to string matching #4576
Conversation
477293d
to
6d4fd1a
Compare
|
I didn't know what By the way, if Presto has |
6d4fd1a
to
e19f549
Compare
Yes, that makes sense (for now -- eventually we should be able to get rid of DomainTranslator or drastically reduce the scope of what it does and where it's used). |
Is there a possibility to adopt this kind of optimization? If this optimization has a possibility to be adopted but adding new UDFs is not an ideal solution, I would propose two options:
|
hi, what's the reason we haven't applied the optimzation in DesugarLikeRewriter? I think it would help a lot. |
the rewrite could also happen in ExpressionInterpreter.visitLikePredicate() |
FYI, as part of #13184, we're trying to remove usage of LikePredicate within the optimizer, as well as all desugaring rules. Those will be part of the initial translation of SQL query AST -> Plan IR. |
It's possible some of the rewrites proposed here are still relevant, but they will need to be reimplemented to match the function calls for the like matching functions instead of the Like expression node, as that's going away in the planner very soon (as part of #13961) |
Sounds like it's better to raise a fresh pull request after #13961. I would close this pull request for now. |
Improve
LIKE
predicates performance by rewriting to UDFs which don't use a regular expression.ENDS_WITH
andCONTAINS
functionsLIKE
predicates toSTARTS_WITH
,ENDS_WITH
orCONTAINS
if possible