drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khurram Faraaz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-4351) SQL keyword CURRENT is used as column name in sys.drillbits
Date Thu, 04 Feb 2016 04:58:39 GMT
Khurram Faraaz created DRILL-4351:
-------------------------------------

             Summary: SQL keyword CURRENT is used as column name in sys.drillbits
                 Key: DRILL-4351
                 URL: https://issues.apache.org/jira/browse/DRILL-4351
             Project: Apache Drill
          Issue Type: Bug
          Components: SQL Parser
    Affects Versions: 1.5.0
            Reporter: Khurram Faraaz


current is a SQL keyword, we will have to rename it to a different word, say foreman, in sys.drillbits
table. We hit this issue when user tries to project the column named current in sys.drillbits

Drill git commit ID : 6a36a704 (1.5.0-SNAPSHOT)
JDK8

current is a keyword in these DBMSs
MS SQL Server
Oracle
DB2 

{noformat}
0: jdbc:drill:schema=dfs.tmp> select * from sys.drillbits;
+-------------------+------------+---------------+------------+----------+
|     hostname      | user_port  | control_port  | data_port  | current  |
+-------------------+------------+---------------+------------+----------+
| centos-03.qa.lab  | 31010      | 31011         | 31012      | true     |
| centos-01.qa.lab  | 31010      | 31011         | 31012      | false    |
| centos-02.qa.lab  | 31010      | 31011         | 31012      | false    |
| centos-04.qa.lab  | 31010      | 31011         | 31012      | false    |
+-------------------+------------+---------------+------------+----------+
4 rows selected (0.238 seconds)
0: jdbc:drill:schema=dfs.tmp> select hostname from sys.drillbits;
+-------------------+
|     hostname      |
+-------------------+
| centos-03.qa.lab  |
| centos-01.qa.lab  |
| centos-02.qa.lab  |
| centos-04.qa.lab  |
+-------------------+
4 rows selected (0.178 seconds)

0: jdbc:drill:schema=dfs.tmp> select current from sys.drillbits;
Error: PARSE ERROR: Encountered "current from" at line 1, column 8.
Was expecting one of:
    "UNION" ...
    "INTERSECT" ...
    "EXCEPT" ...
    ...
    "EXISTS" ...
    "(" ...


while parsing SQL query:
select current from sys.drillbits
       ^


[Error Id: 07e0161c-9c36-44bb-b584-40fef11fa9e8 on centos-03.qa.lab:31010] (state=,code=0)
 
{noformat}

>From drillbit.log
 
 {noformat}
 [Error Id: 07e0161c-9c36-44bb-b584-40fef11fa9e8 ]
        at org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:543)
~[drill-common-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:164)
[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:924) [drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:250) [drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[na:1.8.0_65]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[na:1.8.0_65]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]
Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "current from" at
line 1, column 8.
Was expecting one of:
    "UNION" ...
    "INTERSECT" ...
    "EXCEPT" ...
    "ORDER" ...
    "LIMIT" ...
    "OFFSET" ...
    "FETCH" ...
    "STREAM" ...
    "DISTINCT" ...
    "ALL" ...
    "*" ...
    "+" ...
    "-" ...
    <UNSIGNED_INTEGER_LITERAL> ...
    <DECIMAL_NUMERIC_LITERAL> ...
    <APPROX_NUMERIC_LITERAL> ...
    <BINARY_STRING_LITERAL> ...
    <PREFIXED_STRING_LITERAL> ...
    <QUOTED_STRING> ...
    <UNICODE_STRING_LITERAL> ...
    "TRUE" ...
    "FALSE" ...
    "UNKNOWN" ...
    "NULL" ...
    <LBRACE_D> ...
    <LBRACE_T> ...
    <LBRACE_TS> ...
    "DATE" ...
    "TIME" ...
    "TIMESTAMP" ...
    "INTERVAL" ...
    "?" ...
    "CAST" ...
    "EXTRACT" ...
    "POSITION" ...
    "CONVERT" ...
    "TRANSLATE" ...
    "OVERLAY" ...
    "FLOOR" ...
    "CEIL" ...
    "CEILING" ...
    "SUBSTRING" ...
    "TRIM" ...
    <LBRACE_FN> ...
    "MULTISET" ...
    "ARRAY" ...
    "SPECIFIC" ...
    <IDENTIFIER> ...
    <QUOTED_IDENTIFIER> ...
    <BACK_QUOTED_IDENTIFIER> ...
    <BRACKET_QUOTED_IDENTIFIER> ...
    <UNICODE_QUOTED_IDENTIFIER> ...
    "ABS" ...
    "AVG" ...
    "CARDINALITY" ...
    "CHAR_LENGTH" ...
    "CHARACTER_LENGTH" ...
    "COALESCE" ...
    "COLLECT" ...
    "COVAR_POP" ...
    "COVAR_SAMP" ...
    "CUME_DIST" ...
    "COUNT" ...
    "CURRENT_DATE" ...
    "CURRENT_TIME" ...
    "CURRENT_TIMESTAMP" ...
    "DENSE_RANK" ...
    "ELEMENT" ...
    "EXP" ...
    "FIRST_VALUE" ...
    "FUSION" ...
    "GROUPING" ...
    "LAST_VALUE" ...
    "LN" ...
    "LOCALTIME" ...
    "LOCALTIMESTAMP" ...
    "LOWER" ...
    "MAX" ...
    "MIN" ...
    "MOD" ...
    "NULLIF" ...
    "OCTET_LENGTH" ...
    "PERCENT_RANK" ...
    "POWER" ...
    "RANK" ...
    "REGR_SXX" ...
    "REGR_SYY" ...
    "ROW_NUMBER" ...
    "SQRT" ...
    "STDDEV_POP" ...
    "STDDEV_SAMP" ...
    "SUM" ...
    "UPPER" ...
    "VAR_POP" ...
    "VAR_SAMP" ...
    "CURRENT_CATALOG" ...
    "CURRENT_DEFAULT_TRANSFORM_GROUP" ...
    "CURRENT_PATH" ...
    "CURRENT_ROLE" ...
    "CURRENT_SCHEMA" ...
    "CURRENT_USER" ...
    "SESSION_USER" ...
    "SYSTEM_USER" ...
    "USER" ...
    "NEW" ...
    "CASE" ...
    "NEXT" ...
    "CURRENT" "VALUE" ...
    "CURSOR" ...
    "ROW" ...
    "NOT" ...
    "EXISTS" ...
    "(" ...

        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.convertException(DrillParserImpl.java:391)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.normalizeException(DrillParserImpl.java:121)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:149) ~[calcite-core-1.4.0-drill-r10.jar:1.4.0-drill-r10]
        at org.apache.calcite.prepare.PlannerImpl.parse(PlannerImpl.java:168) ~[calcite-core-1.4.0-drill-r10.jar:1.4.0-drill-r10]
        at org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:162)
[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        ... 5 common frames omitted
Caused by: org.apache.drill.exec.planner.sql.parser.impl.ParseException: Encountered "current
from" at line 1, column 8.
...
   at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.generateParseException(DrillParserImpl.java:17712)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.jj_consume_token(DrillParserImpl.java:17541)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.SelectExpression(DrillParserImpl.java:1687)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.SelectItem(DrillParserImpl.java:1656)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.SelectList(DrillParserImpl.java:1632)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.SqlSelect(DrillParserImpl.java:1170)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.LeafQuery(DrillParserImpl.java:581)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.LeafQueryOrExpr(DrillParserImpl.java:2709)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.QueryOrExpr(DrillParserImpl.java:2628)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.OrderedQueryOrExpr(DrillParserImpl.java:499)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.SqlStmt(DrillParserImpl.java:808)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.SqlStmtEof(DrillParserImpl.java:854)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserImpl.parseSqlStmtEof(DrillParserImpl.java:180)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.drill.exec.planner.sql.parser.impl.DrillParserWithCompoundIdConverter.parseSqlStmtEof(DrillParserWithCompoundIdConverter.java:59)
~[drill-java-exec-1.5.0-SNAPSHOT.jar:1.5.0-SNAPSHOT]
        at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:142) ~[calcite-core-1.4.0-drill-r10.jar:1.4.0-drill-r10]
        ... 7 common frames omitted
 {noformat}



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

Mime
View raw message