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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]