[
https://issues.apache.org/jira/browse/PHOENIX-6453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17343849#comment-17343849
]
ASF GitHub Bot commented on PHOENIX-6453:
-----------------------------------------
stoty commented on a change in pull request #1220:
URL: https://github.com/apache/phoenix/pull/1220#discussion_r631781475
##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ScanUtil.java
##########
@@ -363,10 +363,12 @@ public static void setTimeRange(Scan scan, long minStamp,
long maxStamp) {
}
int[] position = new int[slots.size()];
int maxLength = 0;
+ int slotEndingFieldPos = 0;
for (int i = 0; i < position.length; i++) {
position[i] = bound == Bound.LOWER ? 0 : slots.get(i).size()-1;
KeyRange range = slots.get(i).get(position[i]);
- Field field = schema.getField(i + slotSpan[i]);
+ slotEndingFieldPos = slotEndingFieldPos + slotSpan[i] + (i>0? 1:
0);
Review comment:
nit:
This is quite confusing : `+ (i>0? 1: 0);` .
Can we increment slotEndingFieldPos at the end of the for cycle body instead?
Or just initialize slotEndingFieldPos to -1 , and increment it here
unconditionally ?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> Possible ArrayIndexOutOfBoundsException while preparing scan start key with
> multiple key range queries
> ------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-6453
> URL: https://issues.apache.org/jira/browse/PHOENIX-6453
> Project: Phoenix
> Issue Type: Bug
> Reporter: Rajeshbabu Chintaguntla
> Assignee: Rajeshbabu Chintaguntla
> Priority: Blocker
> Fix For: 4.17.0, 5.1.2
>
>
> There is possible AIOOE when there are multiple key range conditions on
> columns in a query.
> {noformat}
> java.lang.ArrayIndexOutOfBoundsException: 25
> at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:474)
> at org.apache.phoenix.util.ScanUtil.setKey(ScanUtil.java:408)
> at org.apache.phoenix.util.ScanUtil.getKey(ScanUtil.java:380)
> at org.apache.phoenix.util.ScanUtil.getMinKey(ScanUtil.java:353)
> at org.apache.phoenix.compile.ScanRanges.create(ScanRanges.java:134)
> at
> org.apache.phoenix.compile.WhereOptimizer.pushKeyExpressionsToScan(WhereOptimizer.java:355)
> at
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:171)
> at
> org.apache.phoenix.compile.WhereCompiler.compile(WhereCompiler.java:118)
> at
> org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:747)
> at
> org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:674)
> at
> org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:251)
> at
> org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:178)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:501)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:464)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:306)
> at
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:295)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:294)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:287)
> at
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1930)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)