spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From icexelloss <...@git.apache.org>
Subject [GitHub] spark pull request #22208: [SPARK-25216][SQL] Improve error message when a c...
Date Fri, 24 Aug 2018 18:29:20 GMT
Github user icexelloss commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22208#discussion_r212716787
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -216,8 +216,16 @@ 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(",
")})""")
    +        if (schema.fieldNames.contains(colName)) {
    +          throw new AnalysisException(
    +            s"""Cannot resolve column name "$colName" among (${schema.fieldNames.mkString(",
")}).
    +               | Try adding backticks to the column name, i.e., `$colName`"""
    --- End diff --
    
    I see, how about:
    ```
    Try adding backticks to the column name, i.e., `$colName`, if $colName is the name of
the whole column
    ```
    I am fine with either one



---

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


Mime
View raw message