godfreyhe commented on a change in pull request #9876: [FLINK-14134][table]
Introduce LimitableTableSource for optimizing limit
URL: https://github.com/apache/flink/pull/9876#discussion_r338941218
##########
File path:
flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/planner/plan/batch/sql/LimitTest.xml
##########
@@ -51,6 +72,27 @@ Calc(select=[a, c])
+- Exchange(distribution=[single])
+- Limit(offset=[0], fetch=[20], global=[false])
+- TableSourceScan(table=[[default_catalog, default_database,
MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+]]>
+ </Resource>
+ </TestCase>
+ <TestCase name="testFetchWithOffsetAndLimitSource">
+ <Resource name="sql">
+ <![CDATA[SELECT a, c FROM LimitTable OFFSET 10 ROWS FETCH NEXT 10 ROWS
ONLY]]>
+ </Resource>
+ <Resource name="planBefore">
+ <![CDATA[
+LogicalSort(offset=[10], fetch=[10])
++- LogicalProject(a=[$0], c=[$2])
+ +- LogicalTableScan(table=[[default_catalog, default_database, LimitTable]])
+]]>
+ </Resource>
+ <Resource name="planAfter">
+ <![CDATA[
+Calc(select=[a, c])
++- Limit(offset=[10], fetch=[10], global=[true])
+ +- Exchange(distribution=[single])
+ +- Limit(offset=[0], fetch=[20], global=[false])
Review comment:
i think this Limit is useless. could we remove this node?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services