[ 
https://issues.apache.org/jira/browse/SPARK-43142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17712383#comment-17712383
 ] 

Willi Raschkowski edited comment on SPARK-43142 at 4/14/23 1:18 PM:
--------------------------------------------------------------------

The solution I'd propose is to have {{DslAttr.attr}} return the attribute it's 
wrapping instead of creating a new attribute.

I'll put up a PR.


was (Author: raschkowski):
The solution I'd propose is to have {{DslAttr.attr}} return the attribute it's 
wrapping instead of creating a new attribute.

> DSL expressions fail on attribute with special characters
> ---------------------------------------------------------
>
>                 Key: SPARK-43142
>                 URL: https://issues.apache.org/jira/browse/SPARK-43142
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Willi Raschkowski
>            Priority: Major
>
> Expressions on implicitly converted attributes fail if the attributes have 
> names containing special characters. They fail even if the attributes are 
> backtick-quoted:
> {code:java}
> scala> import org.apache.spark.sql.catalyst.dsl.expressions._
> import org.apache.spark.sql.catalyst.dsl.expressions._
> scala> "`slashed/col`".attr
> res0: org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute = 
> 'slashed/col
> scala> "`slashed/col`".attr.asc
> org.apache.spark.sql.catalyst.parser.ParseException:
> mismatched input '/' expecting {<EOF>, '.', '-'}(line 1, pos 7)
> == SQL ==
> slashed/col
> -------^^^
> {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

Reply via email to