RussellSpitzer commented on code in PR #14948:
URL: https://github.com/apache/iceberg/pull/14948#discussion_r3320725438
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/source/SparkPartitioningAwareScan.java:
##########
@@ -123,6 +128,34 @@ public Partitioning outputPartitioning() {
}
}
+ @Override
+ public SortOrder[] outputOrdering() {
+ if (!isOrderingEnabled()) {
+ return new SortOrder[0];
+ }
+
+ org.apache.iceberg.SortOrder sortOrder = table().sortOrder();
+ SortOrder[] ordering = Spark3Util.toOrdering(sortOrder);
+ LOG.info(
+ "Reporting sort order {} for table {}: {}", sortOrder.orderId(),
table().name(), ordering);
+
+ return ordering;
+ }
+
+ @Override
+ protected boolean isOrderingEnabled() {
+ if (orderingEnabled == null) {
+ orderingEnabled =
+ !groupingKeyType().fields().isEmpty()
+ && preserveDataOrdering
+ && SortOrderAnalyzer.canReportOrdering(table(), taskGroups(),
groupingKeyType());
+ if (!orderingEnabled) {
+ LOG.info("Not reporting ordering for table {}", table().name());
Review Comment:
We have some odd combinations here that just silently log but maybe should
throw an error. If we preserve data ordering and don't preserve data grouping
false that should probably just break
--
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]