Skip to content

HIVE-29719: NegativeArraySizeException in HybridGrace HashJoin due to integer overflow#6593

Open
Aggarwal-Raghav wants to merge 1 commit into
apache:masterfrom
Aggarwal-Raghav:HIVE-29719
Open

HIVE-29719: NegativeArraySizeException in HybridGrace HashJoin due to integer overflow#6593
Aggarwal-Raghav wants to merge 1 commit into
apache:masterfrom
Aggarwal-Raghav:HIVE-29719

Conversation

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add a check for Integer overflow. Check HIVE-29719

Why are the changes needed?

To fix NegativeArraySizeException when running hybridgrace hash join

Does this PR introduce any user-facing change?

NO

How was this patch tested?

Will see CI output

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor Author

Context:
Observed the following log in hive-server2.err where a query is performing a 6-way INNER JOIN across CTE's followed by LEFT JOIN.

Table ..... stats: [numFiles=1, numRows=2500991, totalSize=14843009, rawDataSize=4009088573, numFilesErasureCoded=1]

Stacktrace:

Caused by: java.lang.RuntimeException: Map operator initialization failed
  at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.init(MapRecordProcessor.java:351)
  at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:292)
  ... 16 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Async Initialization failed. abortRequested=false
  at org.apache.hadoop.hive.ql.exec.Operator.completeInitialization(Operator.java:447)
  at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:382)
  at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:549)
  at org.apache.hadoop.hive.ql.exec.Operator.initializeChildren(Operator.java:503)
  at org.apache.hadoop.hive.ql.exec.Operator.initialize(Operator.java:369)
  at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.init(MapRecordProcessor.java:332)
  ... 17 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NegativeArraySizeException: -2147483648
  at org.apache.hadoop.hive.ql.exec.tez.ObjectCache.retrieve(ObjectCache.java:104)
  at org.apache.hadoop.hive.ql.exec.tez.ObjectCache$1.call(ObjectCache.java:114)
  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  ... 3 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.NegativeArraySizeException: -2147483648
  at org.apache.hadoop.hive.ql.exec.tez.HashTableLoader.load(HashTableLoader.java:292)
  at org.apache.hadoop.hive.ql.exec.MapJoinOperator.loadHashTableInternal(MapJoinOperator.java:381)
  at org.apache.hadoop.hive.ql.exec.MapJoinOperator.loadHashTable(MapJoinOperator.java:448)
  at org.apache.hadoop.hive.ql.exec.MapJoinOperator.lambda$initializeOp$0(MapJoinOperator.java:234)
  at org.apache.hadoop.hive.ql.exec.tez.ObjectCache.retrieve(ObjectCache.java:97)
  ... 5 more
Caused by: java.lang.NegativeArraySizeException: -2147483648
  at org.apache.hadoop.hive.ql.exec.persistence.HybridHashTableContainer.<init>(HybridHashTableContainer.java:366)
  at org.apache.hadoop.hive.ql.exec.persistence.HybridHashTableContainer.<init>(HybridHashTableContainer.java:281)
  at org.apache.hadoop.hive.ql.exec.tez.HashTableLoader.load(HashTableLoader.java:248)
  ... 9 more

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants