Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22208#discussion_r212500744
  
    --- 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 would explain, for instance, if the name parts in the column should be 
kept as the part of its column name, try to quote them by backticks.


---

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

Reply via email to