question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 41984

See original GitHub issue

Hi, Friends. When I run presto on my environment, I encountered the following problems ArrayIndexOutOfBoundsException, I want to resolve it but don’t know what the Block mean and the presto operating principle about this error, could you give me some debugging ideas or related code documentation?

2020-10-15T07:56:18.510Z	INFO	20201015_075618_00218_33tjz.3.0-2-401	stdout	in DictionaryBlock: ids[0] = 41472
2020-10-15T07:56:18.510Z	INFO	20201015_075618_00218_33tjz.3.0-2-401	stdout	in DictionaryBlock: ids[1] = 48384
2020-10-15T07:56:18.510Z	INFO	20201015_075618_00218_33tjz.3.0-2-401	stdout	in DictionaryBlock: ids[2] = 65024
2020-10-15T07:56:18.510Z	INFO	20201015_075618_00218_33tjz.3.0-2-401	stdout	positionCount: 3
2020-10-15T07:56:18.510Z	INFO	20201015_075618_00218_33tjz.3.0-2-401	stdout	the dictionary.getPositionCount 293
2020-10-15T07:56:18.510Z	INFO	20201015_075618_00218_33tjz.3.0-2-401	stdout	position: 41472 # i:0
2020-10-15T07:56:18.510Z	ERROR	remote-task-callback-21	io.prestosql.execution.StageStateMachine	Stage 20201015_075618_00218_33tjz.3 failed
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 41984
	at io.prestosql.spi.block.DictionaryBlock.calculateCompactSize(DictionaryBlock.java:231)
	at io.prestosql.spi.block.DictionaryBlock.getSizeInBytes(DictionaryBlock.java:211)
	at io.prestosql.orc.OrcRecordReader.blockLoaded(OrcRecordReader.java:418)
	at io.prestosql.orc.OrcRecordReader.lambda$nextPage$9(OrcRecordReader.java:404)
	at io.prestosql.orc.OrcRecordReader$$Lambda$5919/00000000B80503D0.accept(Unknown Source)
	at io.prestosql.spi.block.LazyBlock$LazyData.lambda$load$0(LazyBlock.java:403)
	at io.prestosql.spi.block.LazyBlock$LazyData$$Lambda$5921/00000000E006AAB0.accept(Unknown Source)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at io.prestosql.spi.block.LazyBlock$LazyData.load(LazyBlock.java:403)
	at io.prestosql.spi.block.LazyBlock$LazyData.getBlock(LazyBlock.java:354)
	at io.prestosql.spi.block.LazyBlock.getBlock(LazyBlock.java:264)
	at io.prestosql.spi.block.LazyBlock.isNull(LazyBlock.java:253)
	at io.prestosql.spi.block.AbstractSingleMapBlock.isNull(AbstractSingleMapBlock.java:58)
	at io.prestosql.spi.type.TypeUtils.readNativeValue(TypeUtils.java:39)
	at io.prestosql.operator.scalar.MapElementAtFunction.elementAt(MapElementAtFunction.java:149)
	at java.lang.invoke.DirectHandle.invokeExact_thunkArchetype_L(DirectHandle.java:302)
	at java.lang.invoke.AsTypeHandle.invokeExact_thunkArchetype_X(AsTypeHandle.java:49)
	at java.lang.invoke.BruteArgumentMoverHandle.invokeExact_thunkArchetype_X(BruteArgumentMoverHandle.java:404)
	at java.lang.invoke.FilterReturnHandle.invokeExact_thunkArchetype_X(FilterReturnHandle.java:59)
	at java.lang.invoke.AsTypeHandle.invokeExact_thunkArchetype_X(AsTypeHandle.java:49)
	at io.prestosql.$gen.PageFilter_20201015_075454_72.filter(Unknown Source)
	at io.prestosql.$gen.PageFilter_20201015_075454_72.filter(Unknown Source)
	at io.prestosql.operator.project.PageProcessor.createWorkProcessor(PageProcessor.java:121)
	at io.prestosql.operator.ScanFilterAndProjectOperator$SplitToPages.lambda$processPageSource$1(ScanFilterAndProjectOperator.java:266)
	at io.prestosql.operator.ScanFilterAndProjectOperator$SplitToPages$$Lambda$6752/00000000E4059870.apply(Unknown Source)
	at io.prestosql.operator.WorkProcessorUtils.lambda$flatMap$4(WorkProcessorUtils.java:245)
	at io.prestosql.operator.WorkProcessorUtils$$Lambda$6192/00000000B80546F0.process(Unknown Source)
	at io.prestosql.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:319)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:306)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:306)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorUtils.getNextState(WorkProcessorUtils.java:221)
	at io.prestosql.operator.WorkProcessorUtils.lambda$processStateMonitor$2(WorkProcessorUtils.java:200)
	at io.prestosql.operator.WorkProcessorUtils$$Lambda$6197/00000000B8056610.process(Unknown Source)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorUtils.lambda$flatten$6(WorkProcessorUtils.java:277)
	at io.prestosql.operator.WorkProcessorUtils$$Lambda$6194/00000000B8055710.process(Unknown Source)
	at io.prestosql.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:319)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorUtils$3.process(WorkProcessorUtils.java:306)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorUtils.getNextState(WorkProcessorUtils.java:221)
	at io.prestosql.operator.WorkProcessorUtils.lambda$processStateMonitor$2(WorkProcessorUtils.java:200)
	at io.prestosql.operator.WorkProcessorUtils$$Lambda$6197/00000000B8056610.process(Unknown Source)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorUtils.getNextState(WorkProcessorUtils.java:221)
	at io.prestosql.operator.WorkProcessorUtils.lambda$finishWhen$3(WorkProcessorUtils.java:215)
	at io.prestosql.operator.WorkProcessorUtils$$Lambda$6725/00000000B40DBE70.process(Unknown Source)
	at io.prestosql.operator.WorkProcessorUtils$ProcessWorkProcessor.process(WorkProcessorUtils.java:372)
	at io.prestosql.operator.WorkProcessorSourceOperatorAdapter.getOutput(WorkProcessorSourceOperatorAdapter.java:148)
	at io.prestosql.operator.Driver.processInternal(Driver.java:379)
	at io.prestosql.operator.Driver.lambda$processFor$8(Driver.java:283)
	at io.prestosql.operator.Driver$$Lambda$5427/00000000CC0A1210.get(Unknown Source)
	at io.prestosql.operator.Driver.tryWithLock(Driver.java:675)
	at io.prestosql.operator.Driver.processFor(Driver.java:276)
	at io.prestosql.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1075)
	at io.prestosql.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:163)
	at io.prestosql.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:484)
	at io.prestosql.$gen.Presto_64ff0f9_dirty____20201015_075353_2.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:823)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sopel39commented, Oct 28, 2020

ids are selected positions from dictionary block. calculateCompactSize() computes dictionary block size when compacted. compact reduces block mem usage by removing unused positions from dictionary.

I suggest joining PrestoSQL slack (https://prestosql.io/slack.html, particularly #dev channel) so we could help you with the connector. I will close this issue now.

0reactions
xkwangcncommented, Oct 28, 2020

@sopel39 Basically, and I want to use it in my platform. Do you know what the function or variable of calculateCompactSize(), compact(), idsmean in https://github.com/prestosql/presto/blob/master/presto-spi/src/main/java/io/prestosql/spi/block/DictionaryBlock.java, I want to debug my error from here. Thanks for you reply and help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the Array Index Out Of Bounds Excepiton in Java
The ArrayIndexOutOfBoundsException is one of the most common errors in Java. It occurs when a program attempts to access an invalid index in...
Read more >
Error: java.lang.ArrayIndexOutOfBoundsException: Array ...
Hi, Friends. When I run presto on my environment, I encountered the following problems ArrayIndexOutOfBoundsException, I want to resolve it ...
Read more >
Caused by: java.lang.ArrayIndexOutOfBoundsException ...
Caused by : java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0. In my database is one object with the bezeichnung ...
Read more >
Array index out of range' using "Database Conversion Utility"
'ERROR: java.lang.ArrayIndexOutOfBoundsException: Array index out of range' using "Database Conversion Utility" · Problem · Symptom · Cause.
Read more >
3 Tips to solve and Avoid java.lang ... - Javarevisited
The error ArrayIndexOutOfBoundsException: 1 means index 1 is invalid and it's out of bounding i.e. more than the length of the array. Since...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found