Skip to content

Commit 9a936b7

Browse files
committed
minor clean-up, ensuring good CQL output on PARAM
1 parent eb184e1 commit 9a936b7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/main/java/datastax/astra/migrate/CqlHelper.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public void initialize() {
7474
logger.info("PARAM -- maxWriteTimeStampFilter: {} datetime is {}", getMaxWriteTimeStampFilter(),
7575
Instant.ofEpochMilli(getMaxWriteTimeStampFilter() / 1000));
7676
}
77-
logger.info("PARAM -- ORIGIN SELECT Query used: {}", cqlMap.get(CQL.ORIGIN_SELECT));
78-
logger.info("PARAM -- TARGET INSERT Query used: {}", cqlMap.get(CQL.TARGET_INSERT));
79-
logger.info("PARAM -- TARGET SELECT Query used: {}", cqlMap.get(CQL.TARGET_SELECT_ORIGIN_BY_PK));
77+
logger.info("PARAM -- ORIGIN SELECT Query used: {}", getCql(CQL.ORIGIN_SELECT));
78+
logger.info("PARAM -- TARGET INSERT Query used: {}", getCql(CQL.TARGET_INSERT));
79+
logger.info("PARAM -- TARGET SELECT Query used: {}", getCql(CQL.TARGET_SELECT_ORIGIN_BY_PK));
8080
}
8181

8282
public BoundStatement bindInsert(PreparedStatement insertStatement, Row originRow, Row targetRow) {
@@ -128,8 +128,6 @@ public BoundStatement selectFromTargetByPK(PreparedStatement selectStatement, Ro
128128
}
129129

130130
private String cqlOriginSelect() {
131-
String selectCols = propertyHelper.getAsString(KnownProperties.ORIGIN_COLUMN_NAMES);
132-
133131
final StringBuilder selectTTLWriteTimeCols = new StringBuilder();
134132
if (null != getTtlCols()) {
135133
getTtlCols().forEach(col -> {
@@ -157,7 +155,7 @@ private String cqlOriginSelect() {
157155
keyBinds += " AND " + key + "=?";
158156
}
159157
}
160-
fullSelectQuery = "SELECT " + selectCols + selectTTLWriteTimeCols + " FROM " + getOriginKeyspaceTable() + " WHERE " + keyBinds;
158+
fullSelectQuery = "SELECT " + propertyHelper.getAsString(KnownProperties.ORIGIN_COLUMN_NAMES) + selectTTLWriteTimeCols + " FROM " + getOriginKeyspaceTable() + " WHERE " + keyBinds;
161159
}
162160
return fullSelectQuery;
163161
}

0 commit comments

Comments
 (0)