[
https://issues.apache.org/jira/browse/SPARK-13370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15151822#comment-15151822
]
Herman van Hovell commented on SPARK-13370:
-------------------------------------------
Whitespace is optional. This may sound funny, but the following expression is
perfectly legal: {{select 1+1}}. In 99% of the time cases without whitespace
get caught by either eager lexer rules or parse rules.
I'll leave it open for discussion, but I think this is a won't fix.
> Lexer not handling whitespaces properly
> ---------------------------------------
>
> Key: SPARK-13370
> URL: https://issues.apache.org/jira/browse/SPARK-13370
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.0.0
> Reporter: Cheng Lian
>
> I was experimenting numeric suffixes and came to the following wrong query
> string, which should result in a parsing error:
> {code}
> // 1.0L is illegal here
> sqlContext.sql("SELECT 1.0D + 1.0L").show()
> {code}
> However, it gives the following result:
> {noformat}
> +---+
> | L|
> +---+
> |2.0|
> +---+
> {noformat}
> {{explain}} suggests that the {{L}} is recognized as an alias:
> {noformat}
> sqlContext.sql("SELECT 1.0D + 1.0L").explain(true)
> == Parsed Logical Plan ==
> 'Project [unresolvedalias((1.0 + 1.0) AS L#12, None)]
> +- OneRowRelation$
> {noformat}
> Seems that the lexer recognizes {{1.0}} and {{L}} as two tokens as if there's
> an whitespace there.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]