Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-48413

LOJ on subquery with UNNEST for array indexes throwing type error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.1.0
    • None
    • analytics
    • Untriaged
    • 1
    • Unknown
    • CX Sprint 262, CX Sprint 263

    Description

      (Tracking on open source: ASTERIXDB-2960)

       

      A query like this currently throws an error when trying to optimize for an LOJ INLJ:

      SET               `compiler.arrayindex` "true";
      DROP DATAVERSE    TestDataverse IF EXISTS;
      CREATE DATAVERSE  TestDataverse;
      USE               TestDataverse;
      CREATE TYPE       GenericType AS { _id: uuid  };
      CREATE DATASET    IndexedDataset (GenericType)
      PRIMARY KEY       _id AUTOGENERATED;
      CREATE DATASET    ProbeDataset (GenericType)
      PRIMARY KEY       _id AUTOGENERATED;
      CREATE INDEX      TestIdx
      ON                IndexedDataset (
          UNNEST items    
          SELECT val : bigint
      );
       
      FROM             ProbeDataset P
      LEFT OUTER JOIN  ( 
          FROM IndexedDataset I   
          UNNEST I.items II    
          SELECT VALUE II.val
      ) AS IIV
      ON                IIV /* +indexnl */ = TO_BIGINT(P.val)
      SELECT            DISTINCT P;
      

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            glenn.galvizo Glenn Galvizo
            glenn.galvizo Glenn Galvizo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty