Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Kudu_Impala
    • Fix Version/s: Impala 2.8.0
    • Component/s: Frontend
    • Labels:
      None

      Description

      Syntax is invalid but Impala shouldn't hit an NPE.

      I1026 23:49:12.624759 28929 Frontend.java:882] analyze query create external TABLE lineitem_200m_kudu_288 (
      l_shipdate STRING,
      l_orderkey BIGINT,
      l_linenumber BIGINT,
      l_partkey BIGINT,
      l_suppkey BIGINT,
      l_quantity DOUBLE,
      l_extendedprice DOUBLE,
      l_discount DOUBLE,
      l_tax DOUBLE,
      l_returnflag STRING,
      l_linestatus STRING,
      l_commitdate STRING,
      l_receiptdate STRING,
      l_shipinstruct STRING,
      l_shipmode STRING,
      l_comment STRING,
      )
      DISTRIBUTE BY HASH (l_orderkey,l_linenumber) INTO 9 BUCKETS stored as kudu
      TBLPROPERTIES (
      'numFiles'='0', 'kudu.master_addresses'='vd0342.halxg.cloudera.com', 'kudu.num_tablet_replicas'='3',
      'kudu.key_columns'='l_shipdate,l_orderkey,l_linenumber', 'kudu.table_name'='impala::single_node_insert.lineitem_200m_kudu_288',
      'transient_lastDdlTime'='1447213292', 'COLUMN_STATS_ACCURATE'='true', 'totalSize'='0', 'numRows'='18000048306')

      I1026 23:49:12.625527 28929 jni-util.cc:169] org.apache.impala.common.AnalysisException
      	at org.apache.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:382)
      	at org.apache.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:337)
      	at org.apache.impala.service.Frontend.analyzeStmt(Frontend.java:891)
      	at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1120)
      	at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:153)
      Caused by: java.lang.NullPointerException
      	at java.util.ArrayList.addAll(ArrayList.java:559)
      	at org.apache.impala.analysis.CUP$SqlParser$actions.case138(SqlParser.java:23193)
      	at org.apache.impala.analysis.CUP$SqlParser$actions.CUP$SqlParser$do_action(SqlParser.java:10280)
      	at org.apache.impala.analysis.SqlParser.do_action(SqlParser.java:3489)
      	at java_cup.runtime.lr_parser.parse(lr_parser.java:587)
      	at org.apache.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:352)
      	... 4 more
      

        Activity

        Hide
        mjacobs Matthew Jacobs added a comment -

        The issue is more general: creating a table where there is a trailing comma after the columns fails.

        [localhost:21000] > create table foo (id int, x int,);
        Query: create table foo (id int, x int,)
        ERROR: AnalysisException: null
        CAUSED BY: NullPointerException: null
        

        This should be a simple fix in the parser.

        Show
        mjacobs Matthew Jacobs added a comment - The issue is more general: creating a table where there is a trailing comma after the columns fails. [localhost:21000] > create table foo (id int , x int ,); Query: create table foo (id int , x int ,) ERROR: AnalysisException: null CAUSED BY: NullPointerException: null This should be a simple fix in the parser.
        Hide
        mjacobs Matthew Jacobs added a comment -

        commit a9a00858da2fca89de0efc54393a97c68c033ea6
        Author: Matthew Jacobs <mj@cloudera.com>
        Date: Thu Oct 27 13:12:51 2016 -0700

        IMPALA-4384: NPE when cols list has trailing comma

        The changes to introduce new PRIMARY KEY syntax allowed for
        a table definition to have a list of cols, optionally
        followed by a PRIMARY KEY clause. However, this rule
        was broken and would allow for the list of columns followed
        by a trailing comma.

        [localhost:21000] > create table foo (id int, x int,);
        Query: create table foo (id int, x int,)
        ERROR: AnalysisException: null
        CAUSED BY: NullPointerException: null

        Change-Id: Ibc394dd7e687b501ae7887a51bed2f441d562760
        Reviewed-on: http://gerrit.cloudera.org:8080/4869
        Reviewed-by: Matthew Jacobs <mj@cloudera.com>
        Tested-by: Internal Jenkins

        Show
        mjacobs Matthew Jacobs added a comment - commit a9a00858da2fca89de0efc54393a97c68c033ea6 Author: Matthew Jacobs <mj@cloudera.com> Date: Thu Oct 27 13:12:51 2016 -0700 IMPALA-4384 : NPE when cols list has trailing comma The changes to introduce new PRIMARY KEY syntax allowed for a table definition to have a list of cols, optionally followed by a PRIMARY KEY clause. However, this rule was broken and would allow for the list of columns followed by a trailing comma. [localhost:21000] > create table foo (id int, x int,); Query: create table foo (id int, x int,) ERROR: AnalysisException: null CAUSED BY: NullPointerException: null Change-Id: Ibc394dd7e687b501ae7887a51bed2f441d562760 Reviewed-on: http://gerrit.cloudera.org:8080/4869 Reviewed-by: Matthew Jacobs <mj@cloudera.com> Tested-by: Internal Jenkins

          People

          • Assignee:
            mjacobs Matthew Jacobs
            Reporter:
            mmokhtar Mostafa Mokhtar
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development