You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/05/08 01:32:03 UTC

[GitHub] [iceberg] wypoon commented on a change in pull request #2512: Spark: Support building against both Spark 3.0 and Spark 3.1.

wypoon commented on a change in pull request #2512:
URL: https://github.com/apache/iceberg/pull/2512#discussion_r628658560



##########
File path: spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/utils/DistributionAndOrderingUtils.scala
##########
@@ -118,7 +120,24 @@ object DistributionAndOrderingUtils {
     expr match {
       case s: SortOrder =>
         val catalystChild = toCatalyst(s.expression(), query, resolver)
-        catalyst.expressions.SortOrder(catalystChild, toCatalyst(s.direction), toCatalyst(s.nullOrdering), Set.empty)
+        val ctor: DynConstructors.Ctor[catalyst.expressions.SortOrder] =
+          DynConstructors.builder()
+            .impl(classOf[catalyst.expressions.SortOrder],
+              classOf[catalyst.expressions.Expression],
+              classOf[catalyst.expressions.SortDirection],
+              classOf[catalyst.expressions.NullOrdering],
+              classOf[Seq[catalyst.expressions.Expression]])
+            .impl(classOf[catalyst.expressions.SortOrder],
+              classOf[catalyst.expressions.Expression],
+              classOf[catalyst.expressions.SortDirection],
+              classOf[catalyst.expressions.NullOrdering],
+              classOf[Set[catalyst.expressions.Expression]])
+            .build()
+        if (Spark3VersionUtil.isSpark30) {
+          ctor.newInstance(catalystChild, toCatalyst(s.direction), toCatalyst(s.nullOrdering), Set.empty)

Review comment:
       `Set` does not extend `Seq` nor does `Seq` extend `Set`. I don't know of any common subclass of both in the standard Scala library.




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

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