jyothsnakonisa commented on code in PR #220:
URL: 
https://github.com/apache/cassandra-analytics/pull/220#discussion_r3598209806


##########
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:
   Yes encodePartitionKeys & readPartitionKeys are not used anywhere in 
production code hence removing them should be safe. I will leave it to you 
whether to remove those methods or not.



##########
cassandra-analytics-core/src/test/java/org/apache/cassandra/spark/KryoSerializationTests.java:
##########
@@ -261,7 +261,9 @@ public void testCqlTable(CassandraBridge bridge)
                                       "create table test_keyspace.test_table"
                                       + " (a bigint, b bigint, c bigint, d 
bigint, e bigint, primary key((a, b), c));",
                                       replicationFactor,
-                                      fields);
+                                      fields,
+                                      java.util.Collections.emptySet(),
+                                      java.util.Collections.emptySet());

Review Comment:
   Please remove fully qualified class names.



-- 
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]

Reply via email to