Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/22812#discussion_r228381728
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
---
@@ -2384,14 +2384,23 @@ class Analyzer(
case UnresolvedMapObjects(func, inputData, cls) if
inputData.resolved =>
inputData.dataType match {
case ArrayType(et, cn) =>
- val expr = MapObjects(func, inputData, et, cn, cls)
transformUp {
+ MapObjects(func, inputData, et, cn, cls) transformUp {
case UnresolvedExtractValue(child, fieldName) if
child.resolved =>
ExtractValue(child, fieldName, resolver)
}
- expr
case other =>
throw new AnalysisException("need an array field but got
" + other.catalogString)
}
+ case u: UnresolvedCatalystToExternalMap if u.child.resolved =>
+ u.child.dataType match {
+ case _: MapType =>
+ CatalystToExternalMap(u) transformUp {
+ case UnresolvedExtractValue(child, fieldName) if
child.resolved =>
--- End diff --
When `u.child` is resolved, is there still `UnresolvedExtractValue`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]