Skip to content

Commit f370133

Browse files
authored
Merge pull request #1015: [proxima-direct-io-cassandra] fix USING TTL query construction
2 parents 7d23098 + 513a4f8 commit f370133

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

direct/io-cassandra/src/main/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private Optional<BoundStatement> elementDelete(StreamElement ingest) {
272272

273273
@Override
274274
protected String createInsertStatement(StreamElement element) {
275-
String ttlStatement = ttl > 0 ? ("USING TTL " + ttl + " ") : "";
275+
String ttlStatement = ttl > 0 ? ("AND TTL " + ttl + " ") : "";
276276
if (element.getAttributeDescriptor().isWildcard()) {
277277
// use the first part of the attribute name
278278
String colName = toColName(element.getAttributeDescriptor());

direct/io-cassandra/src/test/java/cz/o2/proxima/direct/io/cassandra/DefaultCqlFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void testIngestWithTtl() {
212212
assertSame(bound, boundStatement.get());
213213
assertEquals(1, preparedStatement.size());
214214
assertEquals(
215-
"UPDATE my_table USING TIMESTAMP ? USING TTL 86400 SET my_attribute=? WHERE hgw=?",
215+
"UPDATE my_table USING TIMESTAMP ? AND TTL 86400 SET my_attribute=? WHERE hgw=?",
216216
preparedStatement.get(0));
217217
}
218218

0 commit comments

Comments
 (0)