[ 
https://issues.apache.org/jira/browse/CALCITE-7156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18018824#comment-18018824
 ] 

Zhen Chen commented on CALCITE-7156:
------------------------------------

If this issue is not resolved, there may be calculation overflow errors when 
the types of limit and offset are bigint. It is uncertain whether this needs to 
be addressed in version 1.41.0, but currently, I do not have a clear idea for a 
solution, so no target version has been specified for resolution.

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

Reply via email to