jberragan commented on code in PR #71:
URL:
https://github.com/apache/cassandra-analytics/pull/71#discussion_r1734986657
##########
cassandra-analytics-core/src/main/java/org/apache/cassandra/spark/sparksql/SparkCellIterator.java:
##########
@@ -325,7 +329,10 @@ private void maybeRebuildClusteringKeys(@NotNull
ByteBuffer columnNameBuf)
{
Object newObj = deserialize(field,
ByteBufferUtils.extractComponent(columnNameBuf, index++));
Object oldObj = values[field.position()];
- if (newRow || oldObj == null || newObj == null ||
!field.equals(newObj, oldObj))
+ // Historically, we compare equality of clustering keys using the
Spark types
+ // to determine if we have moved to a new 'row'. We could also
compare using the Cassandra types
+ // or the raw ByteBuffers before converting to Spark types - this
mightb be slightly more performant.
+ if (newRow || oldObj == null || newObj == null ||
!sparkSqlTypeConverter.toSparkType(field.type()).equals(newObj, oldObj))
Review Comment:
TODO: convert CqlType to SparkType once in the constructor and re-use.
--
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]