我尝试在pythonapi中使用sparkstreaming和sparksql。你知道吗
我有一个不断编辑的文件,每N秒随机添加一些行。你知道吗
这个文件可以是JSON、XML、CSV或TXT,甚至是SQL表:我完全可以根据自己的情况选择最佳解决方案。你知道吗
我有一定数量的字段,大约4-5个。以下表为例:
+-------+------+-------+--------------------+
| event | id | alert | datetime |
+-------+------+-------+--------------------+
| reg | 1 | def1 | 06.06.17-17.24.30 |
+-------+------+-------+--------------------+
| alt | 2 | def2 | 06.06.17-17.25.11 |
+-------+------+-------+--------------------+
| mot | 3 | def5 | 06.06.17-17.26.01 |
+-------+------+-------+--------------------+
| mot | 4 | def5 | 06.06.17-17.26.01 |
+-------+------+-------+--------------------+
我只想用Spark Streaming流新台词。因此,如果我添加了两个新行,下次我只想流式处理这两行,而不是整个文件(已经流式处理)
此外,我希望在每次找到新行时,对整个同一个文件过滤或计算sparksql查询。例如,我只想在事件"mot"
在10分钟内出现两次时选择它,并且每次文件更改和新数据到达时都必须重新执行此查询。你知道吗
sparkstreaming和sparksql能处理这些情况吗?怎么做?你知道吗
file sources Spark不支持它
对于legacy streaming也是如此(注意2.2文档,但是实现没有改变)
相关问题 更多 >
编程相关推荐