Hello Zoltan Borok-Nagy, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/24095
to look at the new patch set (#4).
Change subject: IMPALA-7618: Accept reversed comparators (> / >=) in range
partition bounds
......................................................................
IMPALA-7618: Accept reversed comparators (> / >=) in range partition bounds
The SQL parser only accepted '<' and '<=' operators in range partition
bounds, rejecting logically equivalent forms like 'VALUES >= X' and
'X > VALUES'. This created an inconsistency where SHOW RANGE PARTITIONS
displayed bounds using '>=' notation that couldn't be used in DDL.
Fix the parser grammar to accept '>' and '>=' in the range bound rules
(renamed to expr_cmp_range_val and cmp_expr_range_val, since either can
denote a lower or an upper bound). Each rule normalizes its comparator to
the canonical 'bound <cmp> VALUES' form, so a RangeBound with a '<' / '<='
comparator always denotes a lower bound and a '>' / '>=' comparator an
upper bound. RangeBound exposes this via a BoundType enum (LOWER_BOUND,
UPPER_BOUND) and a boundType() method.
createFromRangeWithNormalization() uses boundType() to place each bound on
its correct side regardless of syntactic position, so canonical and
reversed forms produce identical internal representations. It now also
rejects specifications where both bounds constrain the same side, e.g.
'4 > VALUES < 2' or '4 < VALUES > 1'.
Testing:
- ParserTest: added reversed-comparator forms for CREATE TABLE and
ALTER TABLE ADD/DROP RANGE PARTITION.
- AnalyzeKuduDDLTest: added reversed-comparator forms (including both
bounds reversed) and error cases for same-side bounds.
Change-Id: Ia12668537bfc72cc9399a60f68ca7608422b35c2
Generated-by: Claude Opus 4.8
---
A 2026-07-09-103045-continua-con-los-cambios-a-partir-del-feedback-de.txt
M fe/src/main/cup/sql-parser.cup
A fe/src/main/java/org/apache/impala/analysis/RangeBound.java
M fe/src/main/java/org/apache/impala/analysis/RangePartition.java
M fe/src/test/java/org/apache/impala/analysis/AnalyzeKuduDDLTest.java
M fe/src/test/java/org/apache/impala/analysis/ParserTest.java
6 files changed, 817 insertions(+), 28 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/95/24095/4
--
To view, visit http://gerrit.cloudera.org:8080/24095
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia12668537bfc72cc9399a60f68ca7608422b35c2
Gerrit-Change-Number: 24095
Gerrit-PatchSet: 4
Gerrit-Owner: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>