【问题标题】:Not getting incremental data with jdbc importer from sql to elastic search没有使用 jdbc 导入器从 sql 获取增量数据到弹性搜索
【发布时间】:2023-03-28 23:43:01
【问题描述】:

根据 jdbc 进口商:

建议使用 UTC 时间戳进行同步。此示例使用毫秒分辨率列 mytimestamp 获取自上次运行以来添加的所有产品行:

{
    "type" : "jdbc",
    "jdbc" : {
        "url" : "jdbc:mysql://localhost:3306/test",
        "user" : "",
        "password" : "",
        "sql" : [
            {
                "statement" : "select * from \"products\" where \"mytimestamp\" > ?",
                "parameter" : [ "$metrics.lastexecutionstart" ]
            }
        ],
        "index" : "my_jdbc_index",
        "type" : "my_jdbc_type"
    }
}

我想根据格式为 2015-08-20 14:52:09 的列修改数据增量输入数据,我也使用每分钟运行的调度程序。我尝试将 sql 键的值设为

"statement" : "select * from \"products\" where \"modifiedDate\" > ?",

但是数据没有加载。

我错过了什么吗?

【问题讨论】:

    标签: elasticsearch elasticsearch-plugin elasticsearch-jdbc-river


    【解决方案1】:

    lastexecutionstart 的格式类似于“2016-03-27T06:37:09.165Z”。 它包含 'T' 和 'Z' 。所以这就是你的数据没有加载的原因。

    如果您想了解更多。 这是链接 https://github.com/jprante/elasticsearch-jdbc

    【讨论】:

      猜你喜欢
      • 2016-10-30
      • 2018-11-21
      • 1970-01-01
      • 2021-01-20
      • 2019-10-10
      • 2016-05-29
      • 2014-03-17
      • 2021-10-14
      • 1970-01-01
      相关资源
      最近更新 更多