phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ankit Singhal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3505) Potential NullPointerException on close() in OrderedResultIterator
Date Wed, 23 Nov 2016 17:39:58 GMT

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

Ankit Singhal commented on PHOENIX-3505:
----------------------------------------

+1

> Potential NullPointerException on close() in OrderedResultIterator
> ------------------------------------------------------------------
>
>                 Key: PHOENIX-3505
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3505
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>             Fix For: 4.9.1, 4.8.3
>
>         Attachments: PHOENIX-3505.001.patch
>
>
> I observed a NPE in executing query 10 from TPC-H over a Phoenix-4.7ish version at $dayjob.
> {noformat}
> select
> 	c_custkey,
> 	c_name,
> 	sum(l_extendedprice*(1 - l_discount)) as revenue,
> 	c_acctbal,
> 	n_name,
> 	c_address,
> 	c_phone,
> 	c_comment
> from
> 	customer,
> 	orders,
> 	lineitem,
> 	nation
> where
> 	c_custkey = o_custkey
> 	and l_orderkey = o_orderkey
> 	and o_orderdate >= to_date('1993-07-01')
> 	and o_orderdate < to_date('1993-10-01')
> 	and l_returnflag = 'R'
> 	and c_nationkey = n_nationkey
> group by
> 	c_custkey,
> 	c_name,
> 	c_acctbal,
> 	c_phone,
> 	n_name,
> 	c_address,
> 	c_comment
> order by
> 	revenue desc
> {noformat}
> DDL are:
> {noformat}
> CREATE TABLE NATION  ( N_NATIONKEY  INTEGER NOT NULL,
>                             N_NAME       CHAR(25) NOT NULL,
>                             N_REGIONKEY  INTEGER NOT NULL,
>                             N_COMMENT    VARCHAR(152));
> CREATE TABLE CUSTOMER ( C_CUSTKEY     INTEGER NOT NULL,
>                              C_NAME        VARCHAR(25) NOT NULL,
>                              C_ADDRESS     VARCHAR(40) NOT NULL,
>                              C_NATIONKEY   INTEGER NOT NULL,
>                              C_PHONE       CHAR(15) NOT NULL,
>                              C_ACCTBAL     DECIMAL(15,2)   NOT NULL,
>                              C_MKTSEGMENT  CHAR(10) NOT NULL,
>                              C_COMMENT     VARCHAR(117) NOT NULL);
> CREATE TABLE ORDERS  ( O_ORDERKEY       INTEGER NOT NULL,
>                            O_CUSTKEY        INTEGER NOT NULL,
>                            O_ORDERSTATUS    CHAR(1) NOT NULL,
>                            O_TOTALPRICE     DECIMAL(15,2) NOT NULL,
>                            O_ORDERDATE      DATE NOT NULL,
>                            O_ORDERPRIORITY  CHAR(15) NOT NULL,  
>                            O_CLERK          CHAR(15) NOT NULL, 
>                            O_SHIPPRIORITY   INTEGER NOT NULL,
>                            O_COMMENT        VARCHAR(79) NOT NULL);
> CREATE TABLE LINEITEM ( L_ORDERKEY    INTEGER NOT NULL,
>                              L_PARTKEY     INTEGER NOT NULL,
>                              L_SUPPKEY     INTEGER NOT NULL,
>                              L_LINENUMBER  INTEGER NOT NULL,
>                              L_QUANTITY    DECIMAL(15,2) NOT NULL,
>                              L_EXTENDEDPRICE  DECIMAL(15,2) NOT NULL,
>                              L_DISCOUNT    DECIMAL(15,2) NOT NULL,
>                              L_TAX         DECIMAL(15,2) NOT NULL,
>                              L_RETURNFLAG  CHAR(1) NOT NULL,
>                              L_LINESTATUS  CHAR(1) NOT NULL,
>                              L_SHIPDATE    DATE NOT NULL,
>                              L_COMMITDATE  DATE NOT NULL,
>                              L_RECEIPTDATE DATE NOT NULL,
>                              L_SHIPINSTRUCT CHAR(25) NOT NULL,
>                              L_SHIPMODE     CHAR(10) NOT NULL,
>                              L_COMMENT VARCHAR(44) NOT NULL);
> {noformat}
> We ultimately got a NullPointerException trying to close the PhoenixStatement down in
OrderedResultIterator. The only execution path I can come up with is that the Iterator was
constructor but {{next()}} or {{peek()}} were never called (for whatever reason). Calling
{{close()}} at this point would result in an NPE being thrown.



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

Mime
View raw message