Wenhai created ASTERIXDB-1354:
---------------------------------

             Summary: 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


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
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
}
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"="|"));
Query:
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
Error:
Invalid LSM disk component readerCount: -1 [IllegalStateException]



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

Reply via email to