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

Fix NPE in ThriftMetastoreUtil to provide proper error message #23371

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

xkrogen
Copy link
Member

@xkrogen xkrogen commented Sep 11, 2024

Description

Currently in some cases when Hive partition metadata is corrupted such that a storage descriptor is present, but it doesn't have columns set, you will get an NPE thrown from Trino:

2024-09-06T21:31:06.172Z        ERROR   query-execution-2177492 io.trino.execution.scheduler.PipelinedQueryScheduler    Failure in distributed stage for query 20240906_213105_35785_ujj3t
io.trino.spi.TrinoException: java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because "schema" is null

This PR adds a check to confirm the value is non-null, and throws HIVE_INVALID_METADATA in case it is corrupted instead of NPE, to give a more clear error message and provide more information on which partition's metadata is corrupted.

Release notes

(X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Sep 11, 2024
@github-actions github-actions bot added the hive Hive connector label Sep 11, 2024
@xkrogen xkrogen force-pushed the xkrogen/hive-metastore-fix-npe branch from afaf698 to 397c9e8 Compare September 12, 2024 15:19
@xkrogen xkrogen force-pushed the xkrogen/hive-metastore-fix-npe branch from 397c9e8 to 2b4366f Compare September 12, 2024 17:10
@wendigo wendigo merged commit d55088a into trinodb:master Sep 12, 2024
56 checks passed
@github-actions github-actions bot added this to the 458 milestone Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector
Development

Successfully merging this pull request may close these issues.

None yet

2 participants