英文:
Can dimensions in Apache Druid be considered as a form of primary key?
问题
在Druid中,如果禁用了"rollup",具有相同时间戳和维度(值)的指标值会覆盖先前的指标值吗?
英文:
In other word, in Druid, if rollup is disabled, will metric values with the same timestamp and dimension(value) overwrite former metric value?
答案1
得分: 2
直截了当的答案是:不,它不像一个键一样运作。
Druid使用不可变的文件,称为段(segment),这些段以列式格式包含数百万行。虽然使用完美的滚动汇总进行摄取会创建具有__time和维度的唯一组合的单独行,但这在一般情况下并不成立。
您可以通过使用合并摄取来更新Druid中的数据,这里有一篇关于这个主题的精彩博客。您还可以以类似的方式使用SQL中的REPLACE语句来实现这一点。
对于流摄取和数据更新,有一些查询方法可以获取每列的最新值(有关此内容的博客文章)。
英文:
Straight answer is: No, it does not behave like a key.
Druid uses immutable files called segments, which contain millions of rows each in a columnar format. While ingestion with perfect rollup will create individual rows that are a unique combination of __time and dimensions, this is not true in general.
You can update data in Druid through the use of combining ingestion, here is a great blog on the subject. You can also use REPLACE statements in SQL in the same fashion to achieve this.
For streaming ingestion with data updates, there are query approaches to getting the latest value of each column ( blog post on that ) .
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论