You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/09/16 22:15:00 UTC
[jira] [Commented] (ASTERIXDB-2960) LOJ on subquery with UNNEST for
array indexes throwing type error
[ https://issues.apache.org/jira/browse/ASTERIXDB-2960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17416335#comment-17416335 ]
ASF subversion and git services commented on ASTERIXDB-2960:
------------------------------------------------------------
Commit d74d74196ccdcf9c26219b9440f7ea0c32b0472a in asterixdb's branch refs/heads/master from ggalvizo
[ https://gitbox.apache.org/repos/asf?p=asterixdb.git;h=d74d741 ]
[ASTERIXDB-2960][IDX] LOJ array-index INLJ probe PK fix
- user model changes: no
- storage format changes: no
- interface changes: no
Type errors were being thrown for LOJ on subqueries involving UNNESTed
values for array index INLJ. This was due to a bug where we would try to
perform a DISTINCT on probe PK vars that weren't present. If we cannot
infer any probe entries from the context, then insert a UUID on top of
the probe to allow the DISTINCT to work as intended.
Change-Id: I1eccce55b8d4d2fdb47f678d89fcf957f0ab2ebe
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/13183
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
> LOJ on subquery with UNNEST for array indexes throwing type error
> -----------------------------------------------------------------
>
> Key: ASTERIXDB-2960
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-2960
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: IDX - Indexes
> Reporter: Glenn Justo Galvizo
> Assignee: Glenn Justo Galvizo
> Priority: Major
>
> A query like this currently throws an error when trying to optimize for an LOJ INLJ:
>
> {code:java}
> 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;
> {code}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)