Skip to content

Commit 9b56d88

Browse files
committed
feat(CassandraClient, CassandraSource): Add comments to clarify primary key handling and projection logic
1 parent 2358128 commit 9b56d88

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

connector/src/main/java/com/datastax/oss/cdc/CassandraClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public PreparedStatement prepareSelect(String keyspaceName, String tableName,
167167
CqlIdentifier[] projection,
168168
CqlIdentifier[] pk,
169169
int pkLength) {
170+
// select columns according to projection array length
170171
Select query = selectFrom(keyspaceName, tableName)
171172
.columns(projection.length != 0 ? projection : pk);
172173
for (int i = 0; i < pkLength; i++)

connector/src/main/java/com/datastax/oss/pulsar/source/CassandraSource.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ synchronized void setValueConverterAndQuery(KeyspaceMetadata ksm, TableMetadata
355355
List<ColumnMetadata> columns = tableMetadata.getColumns().values().stream()
356356
// include primary keys in the json only output format options
357357
// TODO: PERF: Infuse the key values instead of reading from DB https://github.com/datastax/cdc-apache-cassandra/issues/84
358+
// If primary key only table, then add all the columns into the value schema.
358359
.filter(c -> config.isJsonOnlyOutputFormat() || isPrimaryKeyOnlyTable || !tableMetadata.getPrimaryKey().contains(c))
359360
.filter(c -> !columnPattern.isPresent() || columnPattern.get().matcher(c.getName().asInternal()).matches())
360361
.collect(Collectors.toList());

0 commit comments

Comments
 (0)