skoppu22 commented on code in PR #220:
URL:
https://github.com/apache/cassandra-analytics/pull/220#discussion_r3538624721
##########
cassandra-four-zero-types/src/main/java/org/apache/cassandra/spark/reader/SchemaBuilder.java:
##########
@@ -222,6 +224,20 @@ private static Pair<KeyspaceMetadata, TableMetadata>
updateSchema(Schema schema,
}
tableMetadata.columns().forEach(columnValidator);
+
+ // This builder always produces an index-less table (indexes are
applied later by the 5.0 bridge), so a
+ // rebuild never carries indexes even if the caller passed index
statements. buildSchema runs repeatedly per
+ // table in a JVM; if an earlier call already registered indexes, copy
them onto this rebuild so it matches
+ // the registered table.
+ if (maybeExistingTableMetadata != null
+ && !maybeExistingTableMetadata.indexes.isEmpty()
+ && tableMetadata.indexes.isEmpty())
+ {
+ tableMetadata = tableMetadata.unbuild()
+
.indexes(maybeExistingTableMetadata.indexes)
+ .build();
+ }
+
Review Comment:
I did restructure and moved SAI specific code to extended class. Now this
comment not applicable I believe
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]