You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "WenDing-Y (via GitHub)" <gi...@apache.org> on 2026/08/14 09:35:14 UTC

[I] [flink] BETWEEN predicate fails at runtime after pushdown: literal extraction missing in PredicateConverter [fluss]

WenDing-Y opened a new issue, #4000:
URL: https://github.com/apache/fluss/issues/4000

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.
   
   
   ### Fluss version
   
   0.9.0 (latest release)
   
   ### Please describe the bug 🐞
   
   `PredicateConverter` mishandles the Flink `BETWEEN` expression when converting to a Fluss `Predicate`: the lower/upper bounds are passed through as raw `ValueLiteralExpression` AST nodes instead of being extracted to real Java literals:
   
   ```java
   // before the fix
   return builder.between(builder.indexOf(fieldRefExpr.getName()), children.get(1), children.get(2));
   This is inconsistent with how EQUALS / IN / LIKE are handled (they all call extractLiteral(...)). The consequence:
   
   toString()-based assertions still pass, because ValueLiteralExpression.toString() prints something like "10", so the converted predicate looks correct (And([GreaterOrEqual(long1, 10), LessOrEqual(long1, 20)])).
   But at runtime, predicate.test(row) fails with Unsupported type: BIGINT in CompareUtils.compareLiteral, because the predicate holds Flink AST nodes rather than typed literal values.
   
   ### Solution
   
   Extract both bounds with `extractLiteral(fieldRefExpr.getOutputDataType(), ...)` before calling `builder.between(...)`, consistent with the other comparison branches (`EQUALS` / `IN` / `LIKE`). Also add a row-evaluation regression test (`testBetweenEvaluatesAgainstRow`) that calls `predicate.test(GenericRow.of(...))` — the kind of test that would have caught this bug, since the previous parameterized test only compared `toString()` output.
   
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org