Granularity when creating reflections via SQL

Hey, I want to create aggregated reflections via dbt / sql with a datetime dimensions. However in the ALTER TABLE documentation, I don’t find anything about setting the granularity of the dimension via SQL. The granularity of datetime dimensions can however be set via UI as described in the guild.

Did anyone find a way how to set it or do you know if this is a planed feature?

Looks like this got missed in the documentation. The SQL grammar looks like:

alter table Samples."samples.dremio.com"."NYC-taxi-trips-iceberg" create aggregate reflection r1 using dimensions ("pickup_datetime" BY DAY)

BTW, you could achieve the same outcome by creating a view that groups by the dataset at the day level and then creating a raw reflection on this view. From the planner point of view, these two reflections are identical.

1 Like