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

Use ErrorClass to Throw AnalysisException [databricks] #10830

Merged
merged 19 commits into from
Jun 4, 2024

Conversation

razajafri
Copy link
Collaborator

@razajafri razajafri commented May 17, 2024

In Spark 4.0.0 the constructor of AnalysisException that takes a String parameter has been protected. To incorporate this change, we are introducing a shim class that will throw the respective errorClass

contributes to #9259

Signed-off-by: Raza Jafri <rjafri@nvidia.com>
@razajafri razajafri requested a review from jlowe May 17, 2024 15:32
@razajafri razajafri changed the title Throw Anonymous Child of AnalysisException [databricks] Throw AnalysisException using Anonymous Class [databricks] May 17, 2024
@razajafri razajafri changed the title Throw AnalysisException using Anonymous Class [databricks] Use ErrorClass to Throw AnalysisException [databricks] May 21, 2024
@razajafri
Copy link
Collaborator Author

@jlowe I think I have addressed all your concerns

@razajafri razajafri changed the base branch from branch-24.06 to branch-24.08 May 28, 2024 17:33
@razajafri razajafri self-assigned this May 29, 2024
@razajafri
Copy link
Collaborator Author

I have addressed all your concerns I think PTAL.
The only thing that you may have questions about is that I have introduced the RapidsAnalysisException which will be thrown even in older versions of Spark instead of Raw AnalysisException

@razajafri
Copy link
Collaborator Author

build

@razajafri
Copy link
Collaborator Author

I have addressed your comments I think.

  • Renamed the method in TrampolineUtil.throwAnalysisException() to TrampolineUtil.throwRapidsAnalysisException
  • Throwing the ErrorMsg.PARTITION_DYN_STA_ORDER.getMsg in dynamicPartitionParentError instead of the errorClass
  • Removed the RapidsErrorUtilsFor340PlusShims

* AnalysisException is thrown directly rather than via an error
* utility class (this should be rare).
*/
def throwRapidsAnalysisException(msg: String) = throw new RapidsAnalysisException(msg)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why we need a TrampolineUtil method to use one of our own classes. Why not have the class that would use this method simply throw RapidsAnalysisException directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't need a TrampolineUtil method, this was a remnant of throwing the AnalysisException.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me get rid of that. Please let me know if there are any other concerns

@razajafri
Copy link
Collaborator Author

build

Copy link
Collaborator

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

I have verified that all of @jlowe's concerns were addressed here.

LGTM!

@razajafri razajafri merged commit 4707406 into NVIDIA:branch-24.08 Jun 4, 2024
44 checks passed
@razajafri razajafri deleted the SP-9259-analysis-exception branch June 4, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spark 4.0+ Spark 4.0+ issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants