liucao-dd commented on code in PR #213:
URL: 
https://github.com/apache/cassandra-analytics/pull/213#discussion_r3329192847


##########
cassandra-analytics-core/src/main/spark4/org/apache/cassandra/spark/sparksql/CassandraPartitioning.java:
##########
@@ -19,21 +19,16 @@
 
 package org.apache.cassandra.spark.sparksql;
 
-import org.apache.cassandra.spark.data.DataLayer;
-import org.apache.spark.sql.connector.read.partitioning.Partitioning;
+import org.apache.spark.sql.connector.read.partitioning.UnknownPartitioning;
 
-class CassandraPartitioning implements Partitioning
+/**
+ * Cassandra input partitions are token ranges, not groups of rows sharing one 
partition key value,
+ * so the connector reports Spark's unknown partitioning rather than 
keyed-group partitioning.
+ */
+class CassandraPartitioning extends UnknownPartitioning

Review Comment:
   Good point. I checked Spark's `Partitioning` contract and several maintained 
Spark V2 connectors (Iceberg, Paimon, Lance). The common pattern is to 
instantiate `UnknownPartitioning` directly when the scan cannot guarantee keyed 
grouping, and reserve `KeyGroupedPartitioning` for cases where the connector 
can prove rows are grouped by the reported key expressions. Updated the patch.



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