databricks - 结构化流上作业管道的 delta Lake 最佳分区策略
问题描述
在我的场景中,我有 2 个结构化流作业,一个写入 Delta Lake 表,第二个从 Delta Lake 表读取的作业处理它并写入另一个表。
对于结构化流(只需要选择在最后一个流批处理之后插入的新记录),我应该创建的分区的最佳选择是什么。如果我在表中使用 CreatedDateTime 列,从该表读取的下一个作业是否将使用该分区。由于我只是使用 readstream(),我不确定它将使用哪个分区。
解决方案
It depends on the data itself on what column you should use for partitioning. If your data is distributed proportionally along the dates, then yes CreatedDateTime would work (what does the histogram look like? Do you not have any "peak" times where a lot of data comes in?). However, if it is not, your primary key might be a safer bet.
推荐阅读
- python - 如何使用分类变量和时间序列制作水平折线图?
- java - 在回调中使用“throws”关键字
- python - 通过共享对象的 __dict__ 属性创建对象视图
- javascript - 未捕获的类型错误:无法读取 javascript 中未定义的属性“样式”
- r - 聚合一列字符串值
- javascript - 如何在调用任何构造函数之前定义所有自定义元素?
- prestashop-1.7 - 如何更改 prestashop 1.7.6.0 中每个项目的文本颜色?
- r - 我在 csv 中有时间序列数据,其中包含重复时间和缺失时间。是否可以将其转换为 xts 对象?
- javascript - 是否可以将内部 Div Click 绑定到外部 Div?
- java - 如何在没有java内存异常的情况下创建一个非常大的矩阵0和1