Hello friends we want create a reflection using SQL but following the documentation we cannot create “AVG” measure that using UI can create,
Unexpected token '"AVG"'. Expecting {COUNT, MAX, MIN, SUM, APPROXIMATE, APPROX}.
Also how can set granularity (type date) in a dimension?
ALTER TABLE "lake2.prod".posts CREATE AGGREGATE REFLECTION lake_prod_posts_all_scan
USING DIMENSIONS (
ID_PAGE,
...
AGE,
CREATED_DATE, --how set granularity (type date)???
)
MEASURES(
ID (COUNT),
....
USERNAME_COMMENTS (APPROX COUNT DISTINCT, COUNT),
COMMENTS (COUNT, SUM)
) partition by (bucket( 400, ID_PAGE ), TYPE, month (CREATED_DATE))