drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Hyde (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-1215) "position" is treated a key word in Drill
Date Wed, 06 Aug 2014 19:48:12 GMT

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

Julian Hyde commented on DRILL-1215:
------------------------------------

The short answer is that POSITION is reserved in the SQL standard, and in Optiq (and hence
Drill), but non-reserved in Postgres.

http://www.postgresql.org/docs/9.2/static/sql-keywords-appendix.html

If a keyword is reserved in the SQL standard, I'd recommend that it is reserved Drill also.
Then your SQL is portable. How difficult is it to type two back-ticks?

> "position" is treated a key word in Drill
> -----------------------------------------
>
>                 Key: DRILL-1215
>                 URL: https://issues.apache.org/jira/browse/DRILL-1215
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: SQL Parser
>            Reporter: Chun Chang
>             Fix For: 0.5.0
>
>
> #Mon Jul 28 09:59:48 PDT 2014
> git.commit.id.abbrev=caa8b78
> Have a table named "position". It appears Drill (optiq) treats "position" as a key word.
Should we? 
> Drill:
> 0: jdbc:drill:schema=dfs> select * from position;
> Query failed: Failure while parsing sql. Encountered "position" at line 1, column 15.
> Was expecting one of:
>     <IDENTIFIER> ...
>     <QUOTED_IDENTIFIER> ...
>     <BACK_QUOTED_IDENTIFIER> ...
>     <BRACKET_QUOTED_IDENTIFIER> ...
>     <UNICODE_QUOTED_IDENTIFIER> ...
>     "LATERAL" ...
>     "(" ...
>     "UNNEST" ...
>     "TABLE" ...
>      [6167fa53-8ef0-49f1-94e1-30c012d388c4]
> Error: exception while executing query (state=,code=0)
> 0: jdbc:drill:schema=dfs> select * from `position`;
> +-------------+----------------+------------+------------+------------+-----------------+
> | position_id | position_title |  pay_type  | min_scale  | max_scale  | management_role
|
> +-------------+----------------+------------+------------+------------+-----------------+
> | 1           | [B@7dd20419    | [B@670b45d7 | 25000.0    | 85000.0    | [B@15165b1b
    |
> postgres:
> foodmart=# select * from position;
>  position_id |      position_title       | pay_type | min_scale  | max_scale  |    management_role
> -------------+---------------------------+----------+------------+------------+-----------------------
>            1 | President                 | Monthly  | 25000.0000 | 85000.0000 | Senior
Management



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message