gengliangwang commented on code in PR #36896: URL: https://github.com/apache/spark/pull/36896#discussion_r900509293
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala: ########## @@ -91,6 +91,27 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog { } } + private def isMapWithStringKey(e: Expression): Boolean = if (e.resolved) { + e.dataType match { + case m: MapType => m.keyType.isInstanceOf[StringType] + case _ => false + } + } else { + false + } + + private def failUnresolvedAttribute( + operator: LogicalPlan, + a: Attribute, + errorClass: String): Nothing = { + val unresolvedAttribute = a.sql + val candidates = operator.inputSet.toSeq.map(_.qualifiedName) + val orderedCandidates = StringUtils.orderStringsBySimilarity(unresolvedAttribute, candidates) + a.failAnalysis( + errorClass = errorClass, + messageParameters = Array(unresolvedAttribute, orderedCandidates.mkString(", "))) Review Comment: I see. I will update this one after https://github.com/apache/spark/pull/36891 is merged. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org