asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wenhai (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ASTERIXDB-1354) Foreign key select error of UNION
Date Mon, 02 May 2016 11:59:12 GMT

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

Wenhai updated ASTERIXDB-1354:
------------------------------
    Description: 
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}

  was:
If we set up a composite primary key (i.e. LineItem(l_orderkey, l_linenumber) referring to
anohter 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}


> 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
>              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)

Mime
View raw message