[
https://issues.apache.org/jira/browse/ASTERIXDB-3065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Glenn Justo Galvizo updated ASTERIXDB-3065:
-------------------------------------------
Description:
There's a bug in the InlineSubplanInputForNestedTupleSourceRule (improper
handling of UNION-ALL). We produce the bug as such:
{code:java}
DROP DATAVERSE Test IF EXISTS;
CREATE DATAVERSE Test;
USE Test;
CREATE TYPE TestType AS { _id : uuid };
CREATE DATASET TestDataset (TestType) PRIMARY KEY _id AUTOGENERATED;
FROM TestDataset P3
LET P12 = (
FROM TestDataset P1
WHERE P3.user_id = P1.user_id
SELECT VALUE P1
UNION ALL
FROM TestDataset P2
WHERE P3.user_id = P1.user_id
SELECT VALUE P2 )
SELECT VALUE P12;
{code}
Executing the query above (with the compiler sanity check) yields the message:
HYR0126: Illegal state. Fired rule
org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule
produced illegal undefined used variables [$$72] in left outer join (eq($$60,
$$72)) – |UNPARTITIONED|
was:
There's a bug in the InlineSubplanInputForNestedTupleSourceRule (improper
handling of UNION-ALL). We produce the bug as such:
{code:java}
DROP DATAVERSE Test IF EXISTS;
CREATE DATAVERSE Test;
USE Test;
CREATE TYPE TestType AS { _id : uuid };
CREATE DATASET TestDataset (TestType) PRIMARY KEY _id AUTOGENERATED;
FROM TestDataset P3
LET P12 = (
FROM TestDataset P1
WHERE P3.user_id = P1.user_id
SELECT VALUE P1
UNION ALL
FROM TestDataset P2
WHERE P3.user_id = P1.user_id
SELECT VALUE P2 )
SELECT VALUE P12;
{code}
Executing the query above (with the compiler sanity check) yields the message:
HYR0126: Illegal state. Fired rule
org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule
produced illegal undefined used variables [$$72] in left outer join (eq($$60,
$$72)) -- |UNPARTITIONED|
> Bug in correlated JOIN subquery with UNION ALL
> ----------------------------------------------
>
> Key: ASTERIXDB-3065
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-3065
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: COMP - Compiler
> Reporter: Glenn Justo Galvizo
> Assignee: Glenn Justo Galvizo
> Priority: Major
>
> There's a bug in the InlineSubplanInputForNestedTupleSourceRule (improper
> handling of UNION-ALL). We produce the bug as such:
> {code:java}
> DROP DATAVERSE Test IF EXISTS;
> CREATE DATAVERSE Test;
> USE Test;
> CREATE TYPE TestType AS { _id : uuid };
> CREATE DATASET TestDataset (TestType) PRIMARY KEY _id AUTOGENERATED;
> FROM TestDataset P3
> LET P12 = (
> FROM TestDataset P1
> WHERE P3.user_id = P1.user_id
> SELECT VALUE P1
> UNION ALL
> FROM TestDataset P2
> WHERE P3.user_id = P1.user_id
> SELECT VALUE P2 )
> SELECT VALUE P12;
> {code}
> Executing the query above (with the compiler sanity check) yields the message:
> HYR0126: Illegal state. Fired rule
> org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule
> produced illegal undefined used variables [$$72] in left outer join
> (eq($$60, $$72)) – |UNPARTITIONED|
--
This message was sent by Atlassian Jira
(v8.20.10#820010)