alamb commented on issue #6181:
URL: 
https://github.com/apache/arrow-datafusion/issues/6181#issuecomment-1529876740

   🤔  I tried to reproduce this error just the datafusion-cli:
   
   ```shell
   cd arrow-datafuson/datafusion-cli
   cargo run 
   ```
   
   ```sql
   ❯ create or replace table t(time timestamp) as values ('2022-01-01'),  
('2022-02-01'), ('2021-01-01');
   0 rows in set. Query took 0.001 seconds.
   ❯ select * from t;
   +---------------------+
   | time                |
   +---------------------+
   | 2022-01-01T00:00:00 |
   | 2022-02-01T00:00:00 |
   | 2021-01-01T00:00:00 |
   +---------------------+
   3 rows in set. Query took 0.002 seconds.
   
   ❯ select date_trunc('year', time) from t;
   +--------------------------------+
   | datetrunc(Utf8("year"),t.time) |
   +--------------------------------+
   | 2022-01-01T00:00:00            |
   | 2022-01-01T00:00:00            |
   | 2021-01-01T00:00:00            |
   +--------------------------------+
   3 rows in set. Query took 0.001 seconds.
   ❯ select date_trunc('YEAR', time) from t;
   Execution error: Unsupported date_trunc granularity: YEAR
   ```
   
   


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