alamb commented on issue #16957:
URL: https://github.com/apache/datafusion/issues/16957#issuecomment-3133672279

   What might be worth doing is writing some tests before we write some code
   
   I think the hard bit about writing tests for this particular feature is that 
this optimization is already done at the logical level
   
   So for example, filters like this that would benefit
   ```sql
   
   DataFusion CLI v49.0.0
   > create table filter_test(string_col varchar, float_col float) as values 
('foo', 1.0), ('bar', 2.0);
   0 row(s) fetched.
   Elapsed 0.007 seconds.
   
   -- note we are comparing a string column to an integer, but datafusion
   -- converts the integer to string (does not cast the column)
   > explain format indent select * from filter_test where string_col = 1;
   
+---------------+-------------------------------------------------------------+
   | plan_type     | plan                                                       
 |
   
+---------------+-------------------------------------------------------------+
   | logical_plan  | Filter: filter_test.string_col = Utf8View("1")             
 |
   |               |   TableScan: filter_test projection=[string_col, 
float_col] |
   | physical_plan | CoalesceBatchesExec: target_batch_size=8192                
 |
   |               |   FilterExec: string_col@0 = 1                             
 |
   |               |     DataSourceExec: partitions=1, partition_sizes=[1]      
 |
   |               |                                                            
 |
   
+---------------+-------------------------------------------------------------+
   2 row(s) fetched.
   Elapsed 0.002 seconds.
   ```
   
   I think to trigger the issue we would have to somehow push down expressions 
that weren't already simplified 🤔 
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to