dongjoon-hyun commented on a change in pull request #25807: [SPARK-25153][SQL] 
Improve error messages for columns with dots/periods
URL: https://github.com/apache/spark/pull/25807#discussion_r326844592
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
 ##########
 @@ -256,8 +256,13 @@ class Dataset[T] private[sql](
   private[sql] def resolve(colName: String): NamedExpression = {
     queryExecution.analyzed.resolveQuoted(colName, 
sparkSession.sessionState.analyzer.resolver)
       .getOrElse {
-        throw new AnalysisException(
-          s"""Cannot resolve column name "$colName" among 
(${schema.fieldNames.mkString(", ")})""")
+        val fields = schema.fieldNames
+        val extraMsg = if 
(fields.exists(sparkSession.sessionState.analyzer.resolver(_, colName))) {
 
 Review comment:
   Please declare `val resolver = sparkSession.sessionState.analyzer.resolver` 
before line 257 because this is used twice.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to