Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-39783

Column backticks are misplaced in the AnalysisException [UNRESOLVED_COLUMN] error message when using field with "."

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete CommentsDelete
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • SQL
    • None

    Description

      AnalysisException [UNRESOLVED_COLUMN.WITH_SUGGESTION] shows the wrong suggestion when a field with the "." separator is referenced without backticks.

      The following code references a nested value `the`.`id`, that does not exist. The proposed / existing column names are not correctly wrapped in backticks:

      Seq((0)).toDF("the.id")
        .select("the.id").show()
      
      org.apache.spark.sql.AnalysisException: [UNRESOLVED_COLUMN.WITH_SUGGESTION] A column or function parameter with name `the`.`id` cannot be resolved. Did you mean one of the following? [`the`.`id`];
      

      Instead of suggesting [`the`.`id`] in the error message, you would expect suggesting [`the.id`].

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            enricomi Enrico Minack Assign to me
            enricomi Enrico Minack
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment