dremio / dbt-dremio

dbt (data build tool) adapter for the Dremio
Apache License 2.0
44 stars 24 forks source link

Reflections: dimensions_by_day not parsed correctly #94

Open ravjotbrar opened 2 years ago

ravjotbrar commented 2 years ago

Looked further into the macro that should handle this logic and only case that’s handled is if dimensions_by_day is None.

Screen Shot 2022-11-24 at 8 16 49 PM

Looking at granularity of a datetime col after specifying it in dimensions and dimensions_by_day should change to 'Date' rather than Original.

LuVlk commented 3 weeks ago

Although documentation says the macro argument is called dimensions_by_day (See: https://github.com/dremio/dbt-dremio/wiki/Using-Materializations-with-Dremio#reflections), the argument is (in version 1.7.0) actually called by_day_dimensions (See: https://github.com/dremio/dbt-dremio/blob/e7b087ed617f1feacb3b4ead44f816a8a5b65338/dbt/include/dremio/macros/materializations/reflection/create_reflection.sql#L41)

The example in the Wiki should be

{{ config(materialized='reflection', 
reflection_type='aggregate', 
dimensions=['Datetime0'], 
by_day_dimensions=['Datetime0'], 
measures=['Num3', 'Int2'], 
computations=['MIN,SUM','COUNT'], 
arrow_cache=true) }}

-- depends_on: {{ ref('my_anchor') }}