Skip to content

LargestTriangleThreeBuckets dowsampling and Materialized View chaining #62849

Answered by den-crane
beebee-ache asked this question in Q&A
Discussion options

You must be logged in to vote

Be careful with column names in MatView, they should match to column names in the destination table

https://den-crane.github.io/Everything_you_should_know_about_materialized_views_commented.pdf

CREATE TABLE downSampled
(
      date_time 
      down_sampled 
)
ENGINE = AggregatingMergeTree() 
ORDER BY date_time;

CREATE MATERIALIZED VIEW downSampled_mv TO downSampled AS 
SELECT toStartOfMinute(dateTime) AS dateTime,    ----<<<<<-  expected date_time !!!
       largestTriangleThreeBuckets(10)(dateTime, value) AS updates   ----<<<<<-  expected down_sampled !!!
FROM rawEvents
GROUP BY dateTime;

Also which dateTime do you want to use here largestTriangleThreeBuckets(10)(dateTime, value)?
rawE…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@beebee-ache
Comment options

@den-crane
Comment options

Answer selected by beebee-ache
Comment options

You must be logged in to vote
4 replies
@beebee-ache
Comment options

@den-crane
Comment options

@den-crane
Comment options

@beebee-ache
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants