<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Phoenix query throwing ArrayIndexOutOfBoundsException in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191325#M65382</link>
    <description>&lt;P&gt;Hi Josh, I am using HDP 2.4.0. The query I am using looks like the following:&lt;/P&gt;&lt;PRE&gt;upsert into TABLE_HBASE_DENORM 
   select 
    TABLE_A.MPK,
    TABLE_A.AAAA,
    TABLE_A.BBBB,
    TABLE_A.CCCC,
    TABLE_A.DDDD,
    TABLE_A.EEEE,
    TABLE_B.AAA,
    TABLE_B.BBB,
    TABLE_B.CCC,
... 26 other parameters ...
    TABLE_A.M4,
    TABLE_A.M3,
    TABLE_A.M2,
    TABLE_A.M1,
    TABLE_A.Q4,
    TABLE_A.Q3,
    TABLE_A.Q2,
    TABLE_A.Q1
   from  
    TABLE_A,
    TABLE_B,
    TABLE_C,
    TABLE_F,
    TABLE_E,
    TABLE_D
   where 
    TABLE_A.AAAA = TABLE_B.AAAA AND
    TABLE_A.BBBB = TABLE_C.BBBB AND
    TABLE_A.CCCC = TABLE_D.CCCC AND   
    TABLE_A.DDDD = TABLE_E.DDDD AND
    TABLE_A.EEEE = TABLE_F.EEEE AND
    
    TABLE_A.Q3 &amp;gt;= TO_TIMESTAMP('2017-03-04 10:40:05') AND TABLE_A.Q3 &amp;lt; TO_TIMESTAMP('2017-03-05 10:40:05') 
 ;
&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Jul 2017 16:12:40 GMT</pubDate>
    <dc:creator>saulo_sobreiro</dc:creator>
    <dc:date>2017-07-27T16:12:40Z</dc:date>
    <item>
      <title>Phoenix query throwing ArrayIndexOutOfBoundsException</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191322#M65379</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am getting an ArrayIndexOutOfBoundsException on a phoenix query and I would like to know if you have any suggestion to solve this problem.&lt;/P&gt;&lt;P&gt;The error is throwing when I select data from some tables to upsert into another. The select query gets all the data from a table that has a considerable amount of data (3 374 590 registers) and merges with data from 5 smaller tables.&lt;/P&gt;&lt;P&gt;I have 4 DataNode/RegiongServer/PhoenixQS (almost dedicated) nodes in the cluster (6 vCPU; 32GB RAM per node), so I believe that resources are not the problem. As a workarround I am filtering by date in order to be able to transfer the data between the tables. It's odd to notice that sometimes I am able to upsert 50k register in a query (a few days), and sometimes I am limited to 9k registers (arround 2 days) or less. I get the error even using a hint to change the join algorithm.&lt;/P&gt;&lt;P&gt;An exemple of the errors I am getting:&lt;/P&gt;&lt;PRE&gt;Error: java.lang.ArrayIndexOutOfBoundsException: -6 (state=08000,code=101)
org.apache.phoenix.exception.PhoenixIOException: java.lang.ArrayIndexOutOfBoundsException: -6
	at org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:108)
	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:538)
	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:510)
	at org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:176)
	at org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:91)
	at org.apache.phoenix.iterate.DelegateResultIterator.next(DelegateResultIterator.java:44)
	at org.apache.phoenix.compile.UpsertCompiler$2.execute(UpsertCompiler.java:737)
	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:305)
	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:297)
	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:295)
	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1255)
	at sqlline.Commands.execute(Commands.java:822)
	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)
Caused by: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: -6
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:202)
	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:534)
	... 16 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -6
	at org.apache.phoenix.util.ByteUtil.vlongFromBytes(ByteUtil.java:329)
	at org.apache.phoenix.util.ByteUtil.vintFromBytes(ByteUtil.java:316)
	at org.apache.phoenix.schema.KeyValueSchema.next(KeyValueSchema.java:208)
	at org.apache.phoenix.schema.KeyValueSchema.iterator(KeyValueSchema.java:165)
	at org.apache.phoenix.schema.KeyValueSchema.iterator(KeyValueSchema.java:171)
	at org.apache.phoenix.schema.KeyValueSchema.iterator(KeyValueSchema.java:175)
	at org.apache.phoenix.expression.ProjectedColumnExpression.evaluate(ProjectedColumnExpression.java:112)
	at org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:69)
	at org.apache.phoenix.jdbc.PhoenixResultSet.getObject(PhoenixResultSet.java:515)
	at org.apache.phoenix.compile.UpsertCompiler.upsertSelect(UpsertCompiler.java:164)
	at org.apache.phoenix.compile.UpsertCompiler.access$000(UpsertCompiler.java:105)
	at org.apache.phoenix.compile.UpsertCompiler$UpsertingParallelIteratorFactory.mutate(UpsertCompiler.java:221)
	at org.apache.phoenix.compile.MutatingParallelIteratorFactory.newIterator(MutatingParallelIteratorFactory.java:61)
	at org.apache.phoenix.iterate.ParallelIterators$1.call(ParallelIterators.java:99)
	at org.apache.phoenix.iterate.ParallelIterators$1.call(ParallelIterators.java:90)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at org.apache.phoenix.job.JobManager$InstrumentedJobFutureTask.run(JobManager.java:172)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745
&lt;/PRE&gt;&lt;P&gt;I am using HDP 2.4.0, so phoenix 4.4. The configurations I am using are:&lt;/P&gt;&lt;PRE&gt;HBase RegionServer Maximum Memory=12288 (12GB)
HBase Master Maximum Memory=12288 (12GB)
Number of Handlers per RegionServer=30
Memstore Flush Size=128MB
Maximum Record Size=1MB
Maximum Region File Size=10GB
% of RegionServer Allocated to Read Buffers=40%
% of RegionServer Allocated to Write Buffers=40%

HBase RPC Timeout=6min
Zookeeper Session Timeout=6min
Phoenix Query Timeout=6min

Number of Fetched Rows when Scanning from Disk=10000
dfs.client.read.shortcircuit=true
dfs.client.read.shortcircuit.buffer.size=131072
hbase.hstore.min.locality.to.skip.major.compact=0.7
hbase.ipc.server.callqueue.read.ratio=0.8
hbase.ipc.server.callqueue.scan.ratio=0.8
phoenix.coprocessor.maxServerCacheTimeToLiveMs=30000
phoenix.mutate.batchSize=100000
phoenix.query.maxServerCacheBytes=8589934592
phoenix.query.queueSize=7500
phoenix.query.threadPoolSize=512
&lt;/PRE&gt;&lt;P&gt;The other configurations are the default.&lt;/P&gt;&lt;P&gt;What should I change in order to make a query of this size work properly?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 03:21:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191322#M65379</guid>
      <dc:creator>saulo_sobreiro</dc:creator>
      <dc:date>2017-07-23T03:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix query throwing ArrayIndexOutOfBoundsException</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191323#M65380</link>
      <description>&lt;P&gt;Can you please share the version of HDP you're running, the table's schema and the UPSERT SELECT command you ran?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 23:01:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191323#M65380</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2017-07-25T23:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix query throwing ArrayIndexOutOfBoundsException</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191324#M65381</link>
      <description>&lt;P&gt;It may be due to &lt;A href="https://issues.apache.org/jira/browse/PHOENIX-2169" target="_blank"&gt;https://issues.apache.org/jira/browse/PHOENIX-2169&lt;/A&gt;&lt;/P&gt;&lt;P&gt;bq.  It's odd to notice that sometimes I am able to upsert 50k register in a query (a few days), and sometimes I am limited to 9k registers (around 2 days) or less&lt;/P&gt;&lt;P&gt;It may happen irregularly when UPSERT SELECT running scans and mutating parallely as our ProjectedColumnExpression is not thread safe. so you may try backporting PHOENIX-2169 in your distribution or upgrade to HDP 2.5 or PHOENIX-4.7.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 13:06:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191324#M65381</guid>
      <dc:creator>asinghal</dc:creator>
      <dc:date>2017-07-26T13:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix query throwing ArrayIndexOutOfBoundsException</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191325#M65382</link>
      <description>&lt;P&gt;Hi Josh, I am using HDP 2.4.0. The query I am using looks like the following:&lt;/P&gt;&lt;PRE&gt;upsert into TABLE_HBASE_DENORM 
   select 
    TABLE_A.MPK,
    TABLE_A.AAAA,
    TABLE_A.BBBB,
    TABLE_A.CCCC,
    TABLE_A.DDDD,
    TABLE_A.EEEE,
    TABLE_B.AAA,
    TABLE_B.BBB,
    TABLE_B.CCC,
... 26 other parameters ...
    TABLE_A.M4,
    TABLE_A.M3,
    TABLE_A.M2,
    TABLE_A.M1,
    TABLE_A.Q4,
    TABLE_A.Q3,
    TABLE_A.Q2,
    TABLE_A.Q1
   from  
    TABLE_A,
    TABLE_B,
    TABLE_C,
    TABLE_F,
    TABLE_E,
    TABLE_D
   where 
    TABLE_A.AAAA = TABLE_B.AAAA AND
    TABLE_A.BBBB = TABLE_C.BBBB AND
    TABLE_A.CCCC = TABLE_D.CCCC AND   
    TABLE_A.DDDD = TABLE_E.DDDD AND
    TABLE_A.EEEE = TABLE_F.EEEE AND
    
    TABLE_A.Q3 &amp;gt;= TO_TIMESTAMP('2017-03-04 10:40:05') AND TABLE_A.Q3 &amp;lt; TO_TIMESTAMP('2017-03-05 10:40:05') 
 ;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jul 2017 16:12:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191325#M65382</guid>
      <dc:creator>saulo_sobreiro</dc:creator>
      <dc:date>2017-07-27T16:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix query throwing ArrayIndexOutOfBoundsException</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191326#M65383</link>
      <description>&lt;P&gt;Just updating phoenix to version 4.7 would solve this issue then? Is it possible to update just the Phoenix version wihtout updating the whole cluster?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 16:15:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191326#M65383</guid>
      <dc:creator>saulo_sobreiro</dc:creator>
      <dc:date>2017-07-27T16:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix query throwing ArrayIndexOutOfBoundsException</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191327#M65384</link>
      <description>&lt;P&gt;I'll not recommend updating a single component in a stack, as there will be some incompatibility and upgrade issues.&lt;/P&gt;&lt;P&gt;I only suspect you might be hitting PHOENIX-2169 so it's better to reproduce the same issue somewhere in pre-prod/dev and see if the fix works and then replicate on production.
&lt;/P&gt;&lt;P&gt;Or, you can talk to your vendor to provide the hotfix for the same version.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 17:11:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191327#M65384</guid>
      <dc:creator>asinghal</dc:creator>
      <dc:date>2017-07-27T17:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Phoenix query throwing ArrayIndexOutOfBoundsException</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191328#M65385</link>
      <description>&lt;P&gt;I will try to reproduce the situation and then apply a fix! &lt;/P&gt;&lt;P&gt;Thanks a lot for your feedback.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2017 17:32:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Phoenix-query-throwing-ArrayIndexOutOfBoundsException/m-p/191328#M65385</guid>
      <dc:creator>saulo_sobreiro</dc:creator>
      <dc:date>2017-07-28T17:32:29Z</dc:date>
    </item>
  </channel>
</rss>

