Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-1354

Foreign key select error of UNION

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: *DB - AsterixDB
    • Labels:
    • Environment:
      General Environment.

      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

      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"="|"));
      

      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]
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                buyingyi Yingyi Bu
                Reporter:
                lwhay Wenhai Li
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: