You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Herman van Hovell (JIRA)" <ji...@apache.org> on 2016/05/02 22:04:12 UTC

[jira] [Comment Edited] (SPARK-13370) Lexer not handling whitespaces properly

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

Herman van Hovell edited comment on SPARK-13370 at 5/2/16 8:03 PM:
-------------------------------------------------------------------

I thought I had fixed this one in the new parser: https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala#L74-L77

But apparently not. The thing is that whitespace is still optional. There is not an easy fix for this (the explicit whitespace approach does not work).


was (Author: hvanhovell):
This one has been fixed with the new parser: https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala#L74-L77

> 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
>            Assignee: Herman van Hovell
>
> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org