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

HIVE-28064: Add cause to ParseException for diagnosability purposes #5067

Closed
wants to merge 1 commit into from

Conversation

zabetak
Copy link
Contributor

@zabetak zabetak commented Feb 6, 2024

What changes were proposed in this pull request and why?

The ParseException contains high level information about problems encountered during parsing but currently the stacktrace is pretty shallow. The end-user gets a hint about what the error might be but the developer has no way to tell how far we went into parsing the given statement and which grammar rule failed to pass.

Add RecognitionException (when available) as cause in ParseException to provide better insights around the origin of the problem and grammar rules that were invoked till the crash.

Does this PR introduce any user-facing change?

People who read the HS2 logs will see the additional stacktrace from the cause of the ParseException.

Is the change a dependency upgrade?

No

How was this patch tested?

Run queries with parse errors via TestMiniLlapLocalCliDriver and inspect logs.

The ParseException contains high level information about problems encountered during parsing but currently the stacktrace is pretty shallow. The end-user gets a hint about what the error might be but the developer has no way to tell how far we went into parsing the given statement and which grammar rule failed to pass.

Add RecognitionException (when available) as cause in ParseException to provide better insights around the origin of the problem and grammar rules that were invoked till the crash.
Copy link

sonarcloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

13 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@zhangbutao zhangbutao left a comment

Choose a reason for hiding this comment

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

LGTM +1

@zabetak zabetak closed this in 6e061e6 Feb 21, 2024
@zabetak zabetak deleted the HIVE-28064 branch February 21, 2024 15:03
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Mar 7, 2024
…Stamatis Zampetakis reviewed by okumin, Butao Zhang)

The ParseException contains high level information about problems encountered during parsing but currently the stacktrace is pretty shallow. The end-user gets a hint about what the error might be but the developer has no way to tell how far we went into parsing the given statement and which grammar rule failed to pass.

Add RecognitionException (when available) as cause in ParseException to provide better insights around the origin of the problem and grammar rules that were invoked till the crash.

Close apache#5067
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants