Skip to content

Commit

Permalink
filter extract
Browse files Browse the repository at this point in the history
  • Loading branch information
yaooqinn committed Nov 22, 2024
1 parent 6c30b51 commit c7ccdaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import java.util.Locale
import scala.collection.mutable

import org.apache.spark.sql.catalyst.SQLConfHelper
import org.apache.spark.sql.catalyst.expressions.{Alias, Expression, SortOrder}
import org.apache.spark.sql.catalyst.expressions.{Alias, Expression, ExtractValue, SortOrder}
import org.apache.spark.sql.catalyst.plans.logical._
import org.apache.spark.sql.connector.catalog.CatalogManager

Expand Down Expand Up @@ -81,6 +81,7 @@ class ResolveReferencesInSort(val catalogManager: CatalogManager)
case _ => Nil
}
lcaCandidates.foreach {
case Alias(_: ExtractValue, _) =>
case a: Alias =>
val lowerCasedName = a.name.toLowerCase(Locale.ROOT)
aliasMap.get(lowerCasedName) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ package object expressions {
val fieldExprs = nestedFields.foldLeft(a: Expression) { (e, name) =>
ExtractValue(e, Literal(name), resolver)
}
Some(Alias(fieldExprs, "_nested_field_" + nestedFields.last)())
Some(Alias(fieldExprs, nestedFields.last)())

case Seq(a) =>
// One match, no nested fields, use it.
Expand Down

0 comments on commit c7ccdaa

Please sign in to comment.