Skip to content

Fix NullPointerException when message isn't included with exception#701

Merged
rdblue merged 1 commit into
apache:masterfrom
cdw9bf:hive-table-operator-npe-fix
Dec 18, 2019
Merged

Fix NullPointerException when message isn't included with exception#701
rdblue merged 1 commit into
apache:masterfrom
cdw9bf:hive-table-operator-npe-fix

Conversation

@cdw9bf
Copy link
Copy Markdown
Contributor

@cdw9bf cdw9bf commented Dec 17, 2019

Why is this change needed?

Some thrift exceptions are thrown without a message. When no message is passed, Iceberg will fail with a NullPointerException when trying to check if the string is in the exception message.

How does this fix the problem?

Does a null check in the first clause of the if statement avoiding checking to see if the string is contained within the message if the message is null. It should not effect the functionality of the check.

Any other important information?

I discovered this error when testing Iceberg for the first time with an improper Hive configuration file. The Thrift exception thrown was because the localhost port it tried to connect to rejected the connection attempt.

Copy link
Copy Markdown
Contributor

@jerryshao jerryshao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@rdblue rdblue merged commit f151144 into apache:master Dec 18, 2019
@rdblue
Copy link
Copy Markdown
Contributor

rdblue commented Dec 18, 2019

Thanks @cdw9bf! I merged this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants