danny0405 commented on a change in pull request #10123: 
[FLINK-14665][table-planner-blink] Support computed column for create…
URL: https://github.com/apache/flink/pull/10123#discussion_r344611623
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml
 ##########
 @@ -638,47 +638,44 @@ SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], 
updateAsRetraction=[false], ac
 LogicalSink(name=[`default_catalog`.`default_database`.`appendSink1`], 
fields=[a, b])
 +- LogicalProject(id1=[$0], EXPR$1=[$2])
    +- LogicalAggregate(group=[{0, 1}], EXPR$1=[LISTAGG($2, $3)])
-      +- LogicalProject(id1=[$0], $f1=[TUMBLE($1, 8000:INTERVAL SECOND)], 
text=[$2], $f3=[_UTF-16LE'#'])
-         +- LogicalProject(id1=[$0], ts=[$2], text=[$1])
-            +- LogicalFilter(condition=[AND(=($0, $3), >($2, -($7, 
300000:INTERVAL MINUTE)), <($2, +($7, 180000:INTERVAL MINUTE)))])
-               +- LogicalJoin(condition=[true], joinType=[inner])
-                  :- LogicalWatermarkAssigner(fields=[id1, text, rowtime], 
rowtimeField=[rowtime], watermarkDelay=[0])
-                  :  +- LogicalTableScan(table=[[default_catalog, 
default_database, T1]])
-                  +- LogicalWatermarkAssigner(fields=[id2, cnt, name, goods, 
rowtime], rowtimeField=[rowtime], watermarkDelay=[0])
-                     +- LogicalTableScan(table=[[default_catalog, 
default_database, T2]])
+      +- LogicalProject(id1=[$0], $f1=[TUMBLE($2, 8000:INTERVAL SECOND)], 
text=[$1], $f3=[_UTF-16LE'#'])
+         +- LogicalFilter(condition=[AND(=($0, $3), >($2, -($7, 
300000:INTERVAL MINUTE)), <($2, +($7, 180000:INTERVAL MINUTE)))])
+            +- LogicalJoin(condition=[true], joinType=[inner])
+               :- LogicalWatermarkAssigner(fields=[id1, text, rowtime], 
rowtimeField=[rowtime], watermarkDelay=[0])
+               :  +- LogicalTableScan(table=[[default_catalog, 
default_database, T1]])
+               +- LogicalWatermarkAssigner(fields=[id2, cnt, name, goods, 
rowtime], rowtimeField=[rowtime], watermarkDelay=[0])
+                  +- LogicalTableScan(table=[[default_catalog, 
default_database, T2]])
 
 LogicalSink(name=[`default_catalog`.`default_database`.`appendSink2`], 
fields=[a, b])
 +- LogicalProject(id1=[$0], EXPR$1=[$2])
    +- LogicalAggregate(group=[{0, 1}], EXPR$1=[LISTAGG($2, $3)])
-      +- LogicalProject(id1=[$0], $f1=[HOP($1, 12000:INTERVAL SECOND, 
6000:INTERVAL SECOND)], text=[$2], $f3=[_UTF-16LE'*'])
-         +- LogicalProject(id1=[$0], ts=[$2], text=[$1])
-            +- LogicalFilter(condition=[AND(=($0, $3), >($2, -($7, 
300000:INTERVAL MINUTE)), <($2, +($7, 180000:INTERVAL MINUTE)))])
-               +- LogicalJoin(condition=[true], joinType=[inner])
-                  :- LogicalWatermarkAssigner(fields=[id1, text, rowtime], 
rowtimeField=[rowtime], watermarkDelay=[0])
-                  :  +- LogicalTableScan(table=[[default_catalog, 
default_database, T1]])
-                  +- LogicalWatermarkAssigner(fields=[id2, cnt, name, goods, 
rowtime], rowtimeField=[rowtime], watermarkDelay=[0])
-                     +- LogicalTableScan(table=[[default_catalog, 
default_database, T2]])
+      +- LogicalProject(id1=[$0], $f1=[HOP($2, 12000:INTERVAL SECOND, 
6000:INTERVAL SECOND)], text=[$1], $f3=[_UTF-16LE'*'])
+         +- LogicalFilter(condition=[AND(=($0, $3), >($2, -($7, 
300000:INTERVAL MINUTE)), <($2, +($7, 180000:INTERVAL MINUTE)))])
+            +- LogicalJoin(condition=[true], joinType=[inner])
+               :- LogicalWatermarkAssigner(fields=[id1, text, rowtime], 
rowtimeField=[rowtime], watermarkDelay=[0])
+               :  +- LogicalTableScan(table=[[default_catalog, 
default_database, T1]])
+               +- LogicalWatermarkAssigner(fields=[id2, cnt, name, goods, 
rowtime], rowtimeField=[rowtime], watermarkDelay=[0])
+                  +- LogicalTableScan(table=[[default_catalog, 
default_database, T2]])
 
 == Optimized Logical Plan ==
-Calc(select=[id1, rowtime AS ts, text], updateAsRetraction=[true], 
accMode=[Acc], reuse_id=[1]): rowcount = , cumulative cost = {rows, cpu, io, 
network, memory}
-+- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=true, 
leftLowerBound=-299999, leftUpperBound=179999, leftTimeIndex=2, 
rightTimeIndex=4], where=[AND(=(id1, id2), >(CAST(rowtime), -(CAST(rowtime0), 
300000:INTERVAL MINUTE)), <(CAST(rowtime), +(CAST(rowtime0), 180000:INTERVAL 
MINUTE)))], select=[id1, text, rowtime, id2, cnt, name, goods, rowtime0], 
updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
-   :- Exchange(distribution=[hash[id1]], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   :  +- WatermarkAssigner(fields=[id1, text, rowtime], 
rowtimeField=[rowtime], watermarkDelay=[0], miniBatchInterval=[None], 
updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
-   :     +- DataStreamScan(table=[[default_catalog, default_database, T1]], 
fields=[id1, text, rowtime], updateAsRetraction=[true], accMode=[Acc]): 
rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   +- Exchange(distribution=[hash[id2]], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- WatermarkAssigner(fields=[id2, cnt, name, goods, rowtime], 
rowtimeField=[rowtime], watermarkDelay=[0], miniBatchInterval=[None], 
updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
-         +- DataStreamScan(table=[[default_catalog, default_database, T2]], 
fields=[id2, cnt, name, goods, rowtime], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=true, 
leftLowerBound=-299999, leftUpperBound=179999, leftTimeIndex=2, 
rightTimeIndex=4], where=[AND(=(id1, id2), >(CAST(rowtime), -(CAST(rowtime0), 
300000:INTERVAL MINUTE)), <(CAST(rowtime), +(CAST(rowtime0), 180000:INTERVAL 
MINUTE)))], select=[id1, text, rowtime, id2, cnt, name, goods, rowtime0], 
updateAsRetraction=[true], accMode=[Acc], reuse_id=[1]): rowcount = , 
cumulative cost = {rows, cpu, io, network, memory}
+:- Exchange(distribution=[hash[id1]], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+:  +- WatermarkAssigner(fields=[id1, text, rowtime], rowtimeField=[rowtime], 
watermarkDelay=[0], miniBatchInterval=[None], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+:     +- DataStreamScan(table=[[default_catalog, default_database, T1]], 
fields=[id1, text, rowtime], updateAsRetraction=[true], accMode=[Acc]): 
rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- Exchange(distribution=[hash[id2]], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   +- WatermarkAssigner(fields=[id2, cnt, name, goods, rowtime], 
rowtimeField=[rowtime], watermarkDelay=[0], miniBatchInterval=[None], 
updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
+      +- DataStreamScan(table=[[default_catalog, default_database, T2]], 
fields=[id2, cnt, name, goods, rowtime], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 Sink(name=[`default_catalog`.`default_database`.`appendSink1`], fields=[a, b], 
updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
-+- GroupWindowAggregate(groupBy=[id1], window=[TumblingGroupWindow('w$, ts, 
8000)], select=[id1, LISTAGG(text, $f3) AS EXPR$1], updateAsRetraction=[false], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- GroupWindowAggregate(groupBy=[id1], window=[TumblingGroupWindow('w$, 
rowtime, 8000)], select=[id1, LISTAGG(text, $f3) AS EXPR$1], 
updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
    +- Exchange(distribution=[hash[id1]], updateAsRetraction=[true], 
accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- Calc(select=[id1, ts, text, _UTF-16LE'#' AS $f3], 
updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
+      +- Calc(select=[id1, rowtime, text, _UTF-16LE'#' AS $f3], 
updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
          +- Reused(reference_id=[1])
 
 Sink(name=[`default_catalog`.`default_database`.`appendSink2`], fields=[a, b], 
updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
-+- GroupWindowAggregate(groupBy=[id1], window=[SlidingGroupWindow('w$, ts, 
6000, 12000)], select=[id1, LISTAGG(text, $f3) AS EXPR$1], 
updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
++- GroupWindowAggregate(groupBy=[id1], window=[SlidingGroupWindow('w$, 
rowtime, 6000, 12000)], select=[id1, LISTAGG(text, $f3) AS EXPR$1], 
updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = 
{rows, cpu, io, network, memory}
 
 Review comment:
   The name was changed because of CALCITE-2718. But because `rowtime ` is not 
a output field, so the final output row type is not changed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to