You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Zhen Chen (Jira)" <ji...@apache.org> on 2025/09/01 14:03:00 UTC

[jira] [Created] (CALCITE-7156) OFFSET and FETCH in EnumerableLimit need to support BIGINT

Zhen Chen created CALCITE-7156:
----------------------------------

             Summary: OFFSET and FETCH in EnumerableLimit need to support BIGINT
                 Key: CALCITE-7156
                 URL: https://issues.apache.org/jira/browse/CALCITE-7156
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.40.0
            Reporter: Zhen Chen


If OFFSET or FETCH in EnumerableLimit is BIGINT, intValue() will truncate OFFSET or FETCH to INT. Since CALCITE-7154 has fixed, it need to be change to longValue().

{code:java}
  static Expression getExpression(RexNode rexNode) {
    if (rexNode instanceof RexDynamicParam) {
      final RexDynamicParam param = (RexDynamicParam) rexNode;
      return Expressions.convert_(
          Expressions.call(DataContext.ROOT,
              BuiltInMethod.DATA_CONTEXT_GET.method,
              Expressions.constant("?" + param.getIndex())),
          Integer.class);
    } else {
      return Expressions.constant(RexLiteral.intValue(rexNode)); <--- here
    }
  }
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)