[ https://issues.apache.org/jira/browse/SPARK-39783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17617509#comment-17617509 ]
Ivan Sadikov edited comment on SPARK-39783 at 10/14/22 7:14 AM: ---------------------------------------------------------------- It is not clear from the ticket, you should update the description to clarify that this is about the error message. I don't see any issues with the error message, "the.id" is unresolved due to the fact that by default this is interpreted as struct field access, not a literal column name. Are you referring to the wrong suggestion in the error message? I opened a PR to fix the suggestion list. was (Author: ivan.sadikov): It is not clear from the ticket, you should update the description to clarify that this is about the error message. I don't see any issues with the error message, "the.id" is unresolved due to the fact that by default this is interpreted as struct field access, not a literal column name. Are you referring to the wrong suggestion in the error message? > Column backticks are misplaced in the AnalysisException [UNRESOLVED_COLUMN] > error message when using field with "." > ------------------------------------------------------------------------------------------------------------------- > > Key: SPARK-39783 > URL: https://issues.apache.org/jira/browse/SPARK-39783 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 3.4.0 > Reporter: Enrico Minack > Priority: Major > > AnalysisException [UNRESOLVED_COLUMN] 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: > {code:scala} > Seq((0)).toDF("the.id") > .select("the.id").show() > org.apache.spark.sql.AnalysisException: [UNRESOLVED_COLUMN] A column or > function parameter with name `the`.`id` cannot be resolved. Did you mean one > of the following? [`the`.`id`]; > {code} > Instead of {{{}[`the`.`id`]{}}}, you would expect {{{}[`the.id`]{}}}. > Here an example where the nested column exists: > {code:scala} > spark.range(1).select(struct("id").as("the")) > .select("the.id").show() > +---+ > | id| > +---+ > | 0| > +---+ > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org