Mihai Budiu created CALCITE-7929:
------------------------------------

             Summary: RelDecorrelator replaces an uncorrelated EXISTS with TRUE 
when the query also has a correlated sub-query
                 Key: CALCITE-7929
                 URL: https://issues.apache.org/jira/browse/CALCITE-7929
             Project: Calcite
          Issue Type: Bug
          Components: core
            Reporter: Mihai Budiu


{code:java}
CREATE TABLE s(x INT);
CREATE TABLE t(y INT);
CREATE VIEW V AS SELECT x,
  EXISTS(SELECT 1 FROM t WHERE y > 5) AS e,         -- becomes the constant TRUE
  EXISTS(SELECT 1 FROM t WHERE t.y = s.x) AS ec     -- the correlated subquery 
starts "Decorrelate"
FROM s; {code}



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to