-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
As @adriangb observes in #12978, there is often special case handling for equality predicates like col = 'foo'
However, sometimes people (or tools) write queries using the LIKE operator:
SELECT ... WHERE col like 'foo'Describe the solution you'd like
I think it would be nice if DataFusion's simplifier could simplify such expressions to WHERE col = 'foo', something that trino does (see trinodb/trino@6aea881#diff-3b166584d367d2e1bf2184249d6bad632bb4ecbe18e011f4744fdf629c771ce7R912)
> explain select * from values ('foo'), ('bar') where column1 like 'foo';
+---------------+---------------------------------------------+
| plan_type | plan |
+---------------+---------------------------------------------+
| logical_plan | Filter: column1 LIKE Utf8("foo") |
| | Values: (Utf8("foo")), (Utf8("bar")) |
| physical_plan | CoalesceBatchesExec: target_batch_size=8192 |
| | FilterExec: column1@0 LIKE foo |
| | ValuesExec |
| | |
+---------------+---------------------------------------------+
2 row(s) fetched.
Elapsed 0.006 seconds.
Describe alternatives you've considered
No response
Additional context
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request