vitaliili-db commented on code in PR #37621:
URL: https://github.com/apache/spark/pull/37621#discussion_r956453516
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -164,35 +164,52 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
s"side of the join. The $side-side columns:
[${plan.output.map(_.name).mkString(", ")}]")
}
+ private def unresolvedAttributeSuggestion(errorClass: String, candidates:
Seq[String]): String = {
+ if (candidates.isEmpty) {
+ ""
+ } else {
+ val candidateIds = candidates.map(toSQLId).mkString(", ")
+ if (errorClass == "UNRESOLVED_MAP_KEY") {
+ s" Otherwise did you mean one of the following column(s)?
[$candidateIds]"
Review Comment:
That is such a great comment! Thank you, I added sub classes for respective
errors. We also have some other instances of hard coded strings, I created a
ticket ([SPARK-40236](https://issues.apache.org/jira/browse/SPARK-40236)) and
fix those.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]