shruti-p-s commented on code in PR #255:
URL: 
https://github.com/apache/cassandra-analytics/pull/255#discussion_r4487278601


##########
cassandra-analytics-cdc-codec/src/main/java/org/apache/cassandra/cdc/avro/AvroBaseRecordTransformer.java:
##########
@@ -71,15 +71,15 @@ public GenericData.Record transform(CdcEvent event)
             ByteBuffer fieldValue = field.getValue();
             Preconditions.checkNotNull(fieldValue, "Field value of column %s 
should not be null for range predicate", field.columnName);
             Schema tableSchema = store.getSchema(event.keyspace + '.' + 
event.table, null);
-            Schema.Field column = tableSchema.getField(field.columnName);
+            Schema.Field column = AvroSchemas.field(tableSchema, 
field.columnName);
             Preconditions.checkNotNull(column,
                                        "Encountered an unknown field during 
range predicate encoding. " +
                                        "Field: %s. Avro schema: %s", 
field.columnName, tableSchema.getFullName());
 
             GenericData.Record update = new GenericData.Record(tableSchema);
             CqlField.CqlType type = 
typeLookup.apply(KeyspaceTypeKey.of(event.keyspace, field.columnType));
             Object javaValue = JavaTypeConverter.deserialize(type, fieldValue);
-            update.put(field.columnName, AvroDataUtils.toAvro(javaValue, 
column.schema()));
+            update.put(column.name(), AvroDataUtils.toAvro(javaValue, 
column.schema()));

Review Comment:
   I think `field` has the same split as the `truncatedFields`.



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