[
https://issues.apache.org/jira/browse/PHOENIX-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15153800#comment-15153800
]
Hudson commented on PHOENIX-2691:
---------------------------------
FAILURE: Integrated in Phoenix-master #1145 (See
[https://builds.apache.org/job/Phoenix-master/1145/])
PHOENIX-2691 Exception while unpacking resultset containing VARCHAR (jtaylor:
rev cac03056578170a82ba812aa4648e0e5b1a1bbb6)
* phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/GroupByCaseIT.java
* phoenix-core/src/main/java/org/apache/phoenix/compile/GroupByCompiler.java
* phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java
* phoenix-core/src/test/java/org/apache/phoenix/compile/QueryCompilerTest.java
> Exception while unpacking resultset containing VARCHAR ARRAY of unspecified
> length
> ----------------------------------------------------------------------------------
>
> Key: PHOENIX-2691
> URL: https://issues.apache.org/jira/browse/PHOENIX-2691
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.6.0, 4.7.0
> Reporter: Nick Dimiduk
> Assignee: James Taylor
> Fix For: 4.7.0
>
> Attachments: 2691.00.patch, PHOENIX-2691.patch, PHOENIX-2691_v2.patch
>
>
> I have an aggregation query that consistently throws with either an
> IllegalArgumentException or an OutOfMemoryException, at the same place.
> Either way, the stack trace is nearly identical:
> {noformat}
> java.lang.IllegalArgumentException
>
> at java.nio.Buffer.position(Buffer.java:244)
>
> at
> org.apache.phoenix.schema.types.PArrayDataType.createPhoenixArray(PArrayDataType.java:1098)
>
> at
> org.apache.phoenix.schema.types.PArrayDataType.toObject(PArrayDataType.java:339)
>
> at
> org.apache.phoenix.schema.types.PVarcharArray.toObject(PVarcharArray.java:65)
>
> at
> org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:985)
>
> at
> org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:75)
>
> at
> org.apache.phoenix.jdbc.PhoenixResultSet.getString(PhoenixResultSet.java:601)
>
> at sqlline.Rows$Row.<init>(Rows.java:183)
>
> at sqlline.BufferedRows.<init>(BufferedRows.java:38)
>
> at sqlline.SqlLine.print(SqlLine.java:1650)
>
> at sqlline.Commands.execute(Commands.java:833)
>
> at sqlline.Commands.sql(Commands.java:732)
>
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
>
> at sqlline.SqlLine.begin(SqlLine.java:681)
>
> at sqlline.SqlLine.start(SqlLine.java:398)
>
> at sqlline.SqlLine.main(SqlLine.java:292)
> {noformat}
> or
> {noformat}
> java.lang.OutOfMemoryError: Java heap space
> at java.lang.reflect.Array.newArray(Native Method)
> at java.lang.reflect.Array.newInstance(Array.java:75)
> at
> org.apache.phoenix.schema.types.PArrayDataType.createPhoenixArray(PArrayDataType.java:1091)
> at
> org.apache.phoenix.schema.types.PArrayDataType.toObject(PArrayDataType.java:339)
> at
> org.apache.phoenix.schema.types.PVarcharArray.toObject(PVarcharArray.java:65)
> at
> org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:985)
> at
> org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:75)
> at
> org.apache.phoenix.jdbc.PhoenixResultSet.getString(PhoenixResultSet.java:601)
> at sqlline.Rows$Row.<init>(Rows.java:183)
> at sqlline.BufferedRows.<init>(BufferedRows.java:38)
> at sqlline.SqlLine.print(SqlLine.java:1650)
> at sqlline.Commands.execute(Commands.java:833)
> at sqlline.Commands.sql(Commands.java:732)
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
> at sqlline.SqlLine.begin(SqlLine.java:681)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:292)
> {noformat}
> Stepping through with the debugger, it appears the {{VARCHAR ARRAY}} value is
> not parsed correctly. The special case of two nulls is not accounted for in
> {{RowKeyValueAccessor#getLength()}}. This results in the offsets being
> slightly wrong and then the value cannot be materialized correctly. Depending
> on what's in the adjacent bytes either an invalid {{position}} call is made,
> resulting in the {{IllegalArgumentException}}, or
> {{PArrayDataType.createPhoenixArray}} attempts to allocate an array of
> ridiculous size, resulting in the OOM.
> It appears the types of the columns returned in the {{KeyValue}} in the
> {{Tuple currentRow}} are ordered {{VARCHAR}}, {{VARCHAR ARRAY}}, {{INTEGER}}.
> I can share the KeyValue bytes with you offline if that will help in
> debugging.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)