Aleksandr Efimov has posted comments on this change. ( http://gerrit.cloudera.org:8080/24268 )
Change subject: IMPALA-14910: Calcite planner: support expressions in limit clause ...................................................................... Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/24268/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaSortSimplifyRule.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaSortSimplifyRule.java: http://gerrit.cloudera.org:8080/#/c/24268/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaSortSimplifyRule.java@50 PS3, Line 50: if (sort.fetch instanceof RexLiteral && sort.offset instanceof RexLiteral) { > Done Checked on PS5 - the early exit now covers the plain "limit 10" shape, and somethingChanged is used. Thanks. http://gerrit.cloudera.org:8080/#/c/24268/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/ImpalaSqlValidatorImpl.java File java/calcite-planner/src/main/java/org/apache/impala/calcite/service/ImpalaSqlValidatorImpl.java: http://gerrit.cloudera.org:8080/#/c/24268/3/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/ImpalaSqlValidatorImpl.java@193 PS3, Line 193: // Offset and limit expressions will always have a BIGINT type. > Moved the logic into CoerceNodes. At that point, we can see if the RexLiter CoerceNodes is a better place for it, and it answers the non-integer question too: "limit 1 + 0.5" reports "LIMIT expression must be an integer type" on PS5 rather than silently truncating. -- To view, visit http://gerrit.cloudera.org:8080/24268 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic01a0144671485156654e7685d0d5816fa743f9d Gerrit-Change-Number: 24268 Gerrit-PatchSet: 3 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]> Gerrit-Comment-Date: Tue, 25 Aug 2026 16:31:28 +0000 Gerrit-HasComments: Yes
