gianm commented on code in PR #13506:
URL: https://github.com/apache/druid/pull/13506#discussion_r1127471929
##########
processing/src/main/java/org/apache/druid/frame/key/ClusterBy.java:
##########
@@ -58,6 +59,21 @@ public ClusterBy(
if (bucketByCount < 0 || bucketByCount > columns.size()) {
throw new IAE("Invalid bucketByCount [%d]", bucketByCount);
}
+
+ // Key must be 100% sortable or 100% nonsortable. If empty, call it
sortable.
+ boolean sortable = true;
+
+ for (int i = 0; i < columns.size(); i++) {
+ final KeyColumn column = columns.get(i);
+
+ if (i == 0) {
+ sortable = column.order().sortable();
+ } else if (sortable != column.order().sortable()) {
+ throw new IAE("Cannot mix sortable and unsortable key columns");
+ }
+ }
+
+ this.sortable = sortable;
Review Comment:
I kept it as-is since they both seem equally good to me and I'm lazy 🙂
--
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]