xiong duan created CALCITE-7328:
-----------------------------------

             Summary: Support SCALAR_QUERY in RelMdExpressionLineage
                 Key: CALCITE-7328
                 URL: https://issues.apache.org/jira/browse/CALCITE-7328
             Project: Calcite
          Issue Type: Bug
            Reporter: xiong duan


The SQL1:
{code:java}
select 
(select max(productid) from products_temporal) as maxValue, 
(select min(productid) from products_temporal) as minValue {code}
The ExpressionLineage of this SQL is NULL.

The SQL2:
{code:java}
select 
productid > (select max(productid) from products_temporal) as productidValues 
from products_temporal {code}
The ExpressionLineage of this SQL is :
{code:java}
[>([CATALOG, SALES, PRODUCTS_TEMPORAL].#0.$0, 
$SCALAR_QUERY({\nLogicalAggregate(group=[{}], EXPR$0=[MAX($0)])\r\n  
LogicalProject(PRODUCTID=[$0])\r\n    LogicalTableScan(table=[[CATALOG, SALES, 
PRODUCTS_TEMPORAL]])\r\n}))]{code}
There are two issues here:
 # SQL1 should return result.
 # Whether or not to unwrap the SCALAR_QUERY. For example in SQL2 like this:

{code:java}
[>([CATALOG, SALES, PRODUCTS_TEMPORAL].#0.$0,MAX[CATALOG, SALES, 
PRODUCTS_TEMPORAL].#0.$0{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to