Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid batch reading of nested decimals as this reader is not implemented #24440

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

denodo-research-labs
Copy link
Contributor

@denodo-research-labs denodo-research-labs commented Jan 27, 2025

Description

Avoid batch reading (set with hive.parquet-batch-read-optimization-enabled=true) of nested decimals as this reader is not implemented.

Reading a nested decimal column defined as:

as_array_big_decimal: OPTIONAL F:1
.list:                REPEATED F:1
..element:            OPTIONAL INT32 L:DECIMAL(1,0) R:1 D:3

without this PR results in the following error:

java.lang.UnsupportedOperationException: com.facebook.presto.common.block.IntArrayBlock

	at com.facebook.presto.common.block.Block.getLong(Block.java:89)
	at com.facebook.presto.common.type.ShortDecimalType.getObjectValue(ShortDecimalType.java:77)
	at com.facebook.presto.common.type.ArrayType.arrayBlockToObjectValues(ArrayType.java:160)
	at com.facebook.presto.common.type.ArrayType.getObjectValue(ArrayType.java:151)
	at com.facebook.presto.hive.parquet.ParquetTester.decodeObject(ParquetTester.java:815)

Motivation and Context

Fixes #23877

Test Plan

Added tests that fail without this PR:

  • testNestedArraysDecimalBackedByINT32
  • testNestedArraysDecimalBackedByINT64
  • testNestedArraysShortDecimalBackedByBinary

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

Hive Connector Changes
* Fix Parquet read failing for nested Decimal types :pr:`24440`

@tdcmeehan tdcmeehan merged commit af6399a into prestodb:master Jan 29, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants