怎么又是你

es中的jdbc,如何使用多次的lastexecutionstart.

Elasticsearch | 作者 cren | 发布于2017年07月24日 | | 阅读数:2157

在jdbc中,如果需要多少使用到时间的值。如果使用lastexecutionstart,分了两次查询,time不一致。对于初始化和热更新都不一致。例如:
sql : [
{ "statement" : "select * from table1 where mytimestamp > ?", "parameter" : [ "$metrics.lastexecutionstart" ] },
{ "statement" : "select * from table2 where mytimestamp > ?", "parameter" : [ "$metrics.lastexecutionstart" ] }
    ],

[尊重社区原创,转载请保留或注明出处]
本文地址:http://elasticsearch.cn/article/197


1 个评论

根据一年前对这个东西的使用经验。。lastexecutionstart不靠谱,会丢数据,
可以考虑把sql 改成
where update_time > date_sub(now, interval 10 minute)
之类的,然后脚本的 schedule 设置为 < 10min
当然,这是在写入量不大的情况下,写入量大的话还是考虑别的方案吧

要回复文章请先登录注册