[
https://issues.apache.org/jira/browse/CALCITE-7156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18018918#comment-18018918
]
Zhen Chen commented on CALCITE-7156:
------------------------------------
I agree, this might be one of the quickest solutions to avoid overflow issues.
Then I'll add a check at the location indicated in the Jira summary—if the
value exceeds the maximum value of int, it will directly throw an error to
alert the user. What do you think?
> 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
> Priority: Major
> Labels: pull-request-available
>
> If OFFSET or FETCH in EnumerableLimit is BIGINT, intValue() will overflow.
> 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)