You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "ConeyLiu (via GitHub)" <gi...@apache.org> on 2023/08/01 14:39:03 UTC

[GitHub] [iceberg] ConeyLiu commented on a diff in pull request #8042: Spark 3.3: Adding Rebalance operator solving for small files problem

ConeyLiu commented on code in PR #8042:
URL: https://github.com/apache/iceberg/pull/8042#discussion_r1280745685


##########
spark/v3.3/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ExtendedDistributionAndOrderingUtils.scala:
##########
@@ -57,10 +57,28 @@ object ExtendedDistributionAndOrderingUtils {
         } else {
           conf.numShufflePartitions
         }
-        // the conversion to catalyst expressions above produces SortOrder expressions
-        // for OrderedDistribution and generic expressions for ClusteredDistribution
-        // this allows RepartitionByExpression to pick either range or hash partitioning
-        RepartitionByExpression(ArraySeq.unsafeWrapArray(distribution), query, finalNumPartitions)
+
+        val isHashDistributionMode = write.requiredDistribution match {
+          case _ : ClusteredDistribution => true
+          case _ => false
+        }
+
+        val strictDistributionMode = conf.getConfString(SparkSQLProperties.STRICT_TABLE_DISTRIBUTION,
+          SparkSQLProperties.STRICT_TABLE_DISTRIBUTION_DEFAULT)
+
+        if (strictDistributionMode.equals("false") && isHashDistributionMode) {

Review Comment:
   `strictDistributionMode` could convert to a boolean easily with `.toBoolean`



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org