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

Herman van Hovell commented on SPARK-14591:
-------------------------------------------

[~yhuai] We define the reserved keywords in here 
https://github.com/apache/spark/blob/master/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4.

Any keyword that is not a part of the {{nonReserved}} rule is a reserved 
keyword. The current reserved keywords can be divided into three groups:
- Symbols: {{+, -, /, !=, <>, ...}}
- Keywords that cannot be made non-reserved (confirmed): {{ANTI, FULL, INNER, 
LEFT, SEMI, RIGHT, NATURAL, UNION, INTERSECT, EXCEPT, DATABASE, SCHEMA}}
- Keyword that can probably be made non-reserved: {{AND, CASE, CAST, CROSS, 
DISTINCT, DIV, ELSE, END, FROM, FUNCTION, HAVING, INTERVAL, JOIN, MACRO, NOT, 
ON, OR, SELECT, STRATIFY, THEN, UNBOUNDED, WHEN, WHERE}}

We could add all reserved keywords to the {{looseNonReserved}} rule and use 
that rule for all names except aliases (which is where we run into trouble).

> Remove org.apache.spark.sql.catalyst.parser.DataTypeParser
> ----------------------------------------------------------
>
>                 Key: SPARK-14591
>                 URL: https://issues.apache.org/jira/browse/SPARK-14591
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Yin Huai
>
> Since our parser defined based on antlr 4 can parse data type (see 
> CatalystSqlParser), we can remove 
> org.apache.spark.sql.catalyst.parser.DataTypeParser. Let's make sure the new 
> parser's functionality is a super set of DataTypeParser. Then, we can remove 
> DataTypeParser. For the object DataTypeParser, we can keep it and let it just 
> call the parserDataType method of CatalystSqlParser.
> *The original description is shown below*
> Right now, our DDLParser does not support {{decimal(precision)}} (the scale 
> will be set to 0). We should support it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to