[ https://issues.apache.org/jira/browse/CALCITE-7328 ]
Zhen Chen deleted comment on CALCITE-7328:
------------------------------------
was (Author: jensen):
I suggest keeping the Agg format unchanged for now. Currently, SQL2 still
outputs a comparison expression. If it didn't return the comparison expression,
something like `[[CATALOG, SALES, PRODUCTS_TEMPORAL].#0.$0, [CATALOG, SALES,
PRODUCTS_TEMPORAL].#0.$0]`, I think it could be simplified. However, I'm not
sure if it should describe the overall relationship X > Y. If it were something
like `select (select productid from products_temporal where productid = 1) as
productid`, I think it would be appropriate to return `[[CATALOG, SALES,
PRODUCTS_TEMPORAL].#0.$0]`. Do you have any better suggestions?
> 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
> Priority: Major
> Labels: pull-request-available
>
> 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)