Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用cassandra时间戳或timeuuid记录sql_last_值_Cassandra_Timestamp_Elastic Stack_Logstash Configuration_Logstash Jdbc - Fatal编程技术网

使用cassandra时间戳或timeuuid记录sql_last_值

使用cassandra时间戳或timeuuid记录sql_last_值,cassandra,timestamp,elastic-stack,logstash-configuration,logstash-jdbc,Cassandra,Timestamp,Elastic Stack,Logstash Configuration,Logstash Jdbc,我们已经配置了JDBCLogstash,通过logstash将数据从Cassandra迁移到elasticsearch。我们已经能够通过logstash将数据从Cassandra移动到elasticsearch,我们还在基于文档id更新elasticsearch中的数据 我们希望基于Cassandra更改进行增量更新,因此我们在logstash input JDBC中使用sql\u last\u值 statement => "SELECT emp_id,emp_city,emp_

我们已经配置了JDBCLogstash,通过logstash将数据从Cassandra迁移到elasticsearch。我们已经能够通过logstash将数据从Cassandra移动到elasticsearch,我们还在基于文档id更新elasticsearch中的数据

我们希望基于Cassandra更改进行增量更新,因此我们在logstash input JDBC中使用sql\u last\u值

statement => "SELECT emp_id,emp_city,emp_name,emp_phone,emp_sal,updated_time FROM cloud.employee_list where updated_time > :sql_last_value and updated_time < toTimestamp(now()) ALLOW FILTERING;"
statement=>“选择emp\u id、emp\u city、emp\u name、emp\u phone、emp\u sal、cloud.employee\u列表,其中updated\u time>:sql\u last\u值和updated\u time
[ERROR]2020-11-05 19:00:00.517[Ruby-0-Thread-26::1]jdbc-Java::JavaSql::SQLException:[Simba][CassandraJDBCDriver](500211)错误无效查询:选择emp_id、emp_city、emp_name、emp_phone、emp_sal、从iqcloud.employee_列表中更新的_时间和更新的_时间'2020-09-09 07:57:12.836000'和更新的时间
在Cassandra时间戳列中,存储如下 2020-09-09 07:57:12.836000+0000, 当我们需要取数时,我们应该删除额外的零,然后像下面那样取数 更新时间='2020-09-09 07:57:12.836'

在错误日志中,由于sql_last_值中的附加零,我们得到的查询无效。是否有任何方法可以在sql_last_值中使用时间戳列值,或者有任何其他方法来实现sql_last_值


有人能澄清一下吗?

一般性评论-Cassandra不是为此类查询而设计的,如果您添加更多数据,查询很可能会失败
[ERROR] 2020-11-05 19:00:00.517 [Ruby-0-Thread-26: :1] jdbc - Java::JavaSql::SQLException: [Simba][CassandraJDBCDriver](500211) ERROR Invalid query: SELECT emp_id,emp_city,emp_name,emp_phone,emp_sal,updated_time FROM iqcloud.employee_list where updated_time > '2020-09-09 07:57:12.836000' and updated_time < toTimestamp(now()) ALLOW FILTERING, Cause: com.simba.cassandra.shaded.datastax.driver.core.exceptions.InvalidQueryException: Unable to coerce '2020-09-09 07:57:12.836000' to a formatted date (long).: SELECT emp_id,emp_city,emp_name,emp_phone,emp_sal,updated_time FROM cloud.employee_list where updated_time > '2020-09-09 07:57:12.836000' and updated_time < toTimestamp(now()) ALLOW FILTERING;