You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Yingyi Bu (JIRA)" <ji...@apache.org> on 2016/08/04 14:30:20 UTC

[jira] [Closed] (ASTERIXDB-1354) Foreign key select error of UNION

     [ https://issues.apache.org/jira/browse/ASTERIXDB-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yingyi Bu closed ASTERIXDB-1354.
--------------------------------
    Resolution: Fixed

Fixed with a regression test.

> Foreign key select error of UNION
> ---------------------------------
>
>                 Key: ASTERIXDB-1354
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1354
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: AsterixDB
>         Environment: General Environment.
>            Reporter: Wenhai
>            Assignee: Yingyi Bu
>            Priority: Critical
>              Labels: patch
>
> If we set up a composite primary key (i.e. LineItem(l_orderkey, l_linenumber)) referring to another table (i.e. Orders(o_orderkey)), the same selection condition will introduce a readCount error.
> Schemas
> {noformat}
> use dataverse tpch;
> create type LineItemType as closed {
>   l_orderkey: int32, 
>   l_partkey: int32, 
>   l_suppkey: int32, 
>   l_linenumber: int32, 
>   l_quantity: int32, 
>   l_extendedprice: double,
>   l_discount: double, 
>   l_tax: double,
>   l_returnflag: string, 
>   l_linestatus: string, 
>   l_shipdate: string,
>   l_commitdate: string, 
>   l_receiptdate: string, 
>   l_shipinstruct: string, 
>   l_shipmode: string, 
>   l_comment: string
> }
> create type OrderType as closed {
>   o_orderkey: int32, 
>   o_custkey: int32, 
>   o_orderstatus: string, 
>   o_totalprice: double, 
>   o_orderdate: string, 
>   o_orderpriority: string,
>   o_clerk: string, 
>   o_shippriority: int32, 
>   o_comment: string
> }
> create dataset LineItem(LineItemType) primary key l_orderkey, l_linenumber;
> create dataset Orders(OrderType) primary key o_orderkey;
> use dataverse tpch;
> load dataset LineItem 
> using localfs
> (("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|"));
> load dataset Orders 
> using localfs
> (("path"="asterix_nc2://data/tpch0.001/orders.tbl"),("format"="delimited-text"),("delimiter"="|"));
> {noformat}
> Query:
> {noformat}
> use dataverse tpch;
> let $l := for $r in dataset LineItem where $r.l_orderkey = 2
> return $r.l_linenumber
> let $o := for $s in dataset Orders where $s.o_orderkey =2
> return $s.o_custkey
> let $c := $l union $o
> return $c
> {noformat}
> Error:
> {noformat}
> Invalid LSM disk component readerCount: -1 [IllegalStateException]
> {noformat}



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