Re:Lesser known features of ClickHouse
by datalopers on Tuesday May 31, 2022 @05:34PM
(#31575231)
CH approach: Load the dynamic data into a JSON field and use materialized columns when needed for performance beyond calling JSONExtract().
[ Parent
| on HN ]
Re:Lesser known features of ClickHouse
by gauravphoenix on Tuesday May 31, 2022 @06:09PM
(#31575531)
the "Object" data type works very well and is quite performant. But do note that if you have lots of "schemas" you will need to create multiple such columns that represent such columns e.g. one column each for GitHub,GitLab etc.
Re:Lesser known features of ClickHouse
by gauravphoenix on Wednesday June 01, 2022 @10:39AM
(#31582435)
> And your materialised view/JsonExtract can be dispatched by schema name for a row.
How would that look like? MatViews in CH are like insert triggers so does it mean that one MatView per schema?
>I see the only suboptimal part if different schemas have different types for the same field and it has to convert it to String.
Agree, this is what I was actually after and it actually happens with system data sometimes- you can have "user" field as an int and string in different schemas.
Is it really the case?
Assume you have column with schema name and one with json object. And your materialised view/JsonExtract can be dispatched by schema name for a row.
I see the only suboptimal part if different schemas have different types for the same field and it has to convert it to String.