gianm commented on code in PR #16849:
URL: https://github.com/apache/druid/pull/16849#discussion_r1708112437
##########
processing/src/main/java/org/apache/druid/segment/Metadata.java:
##########
@@ -233,6 +260,39 @@ public String toString()
", timestampSpec=" + timestampSpec +
", queryGranularity=" + queryGranularity +
", rollup=" + rollup +
+ ", sortOrder=" + sortOrder +
'}';
}
+
+ @Nullable
+ private static List<String> mergeSortOrders(List<List<String>>
sortOrdersToMerge)
+ {
+ if (sortOrdersToMerge.isEmpty()) {
+ return null;
+ }
+
+ if (sortOrdersToMerge.stream().anyMatch(Objects::isNull)) {
+ return null;
+ }
+
+ final List<String> mergedSortOrder = new ArrayList<>();
+
+ while (true) {
+ String column = null;
+
+ for (final List<String> sortOrder : sortOrdersToMerge) {
+ if (mergedSortOrder.size() >= sortOrder.size()) {
Review Comment:
I added some comments and also fixed a problem: `null` is now treated as
`[__time]` (which makes sense, since that was the only possible sort order
prior to the `sortOrder` field being added). Due to this change the method is
no longer `@Nullable`.
--
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]