jberragan commented on code in PR #71:
URL:
https://github.com/apache/cassandra-analytics/pull/71#discussion_r1721417265
##########
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.
+ if (newRow || oldObj == null || newObj == null ||
!sparkSqlTypeConverter.toSparkType(field.type()).equals(newObj, oldObj))
Review Comment:
Not necessarily, comparing with Spark types has worked fine for now.
Comparing the raw bytes could be a bit faster. It is just an assumption that
was intrinsic but not fully called out.
--
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]