jackwener commented on issue #4401:
URL: 
https://github.com/apache/arrow-datafusion/issues/4401#issuecomment-1329306081

   Look like the rule is right 
   
   ```
   after 
   "Projection: datetrunc(Utf8("day"),t.column1) AS day
     Filter: datetrunc(Utf8("day"),t.column1) IS NOT NULL
       Aggregate: groupBy=[[datetrunc(Utf8("day"), t.column1)]], aggr=[[]]
         TableScan: t"
   
   before
   "Projection: datetrunc(Utf8("day"),t.column1) AS day
     Aggregate: groupBy=[[datetrunc(Utf8("day"), t.column1)]], aggr=[[]]
       Filter: datetrunc(Utf8("day"),t.column1) IS NOT NULL
         TableScan: t projection=[column1]"
   ```
   
   I think it's caused by that filter can't eval expression
   
   ```sql
   pg:
   -- create
   CREATE TABLE t (
     column1 TIMESTAMP PRIMARY KEY
   );
   
   -- insert
   INSERT INTO t VALUES ('2022-11-28T18:00:00');
   
   -- fetch 
   select * from t where date_trunc('day', column1) is not null;
   ```
   is ok
   
   ```sql
   CREATE TABLE t AS VALUES (TIMESTAMP '2022-11-28T18:00:00');
   select * from t where date_trunc('day', column1) is not null;
   ```
   failed.
   


-- 
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]

Reply via email to