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

[CDAP-21093] Add ExternalDocumentationLink in abstract sink #533

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

psainics
Copy link
Contributor

@psainics psainics commented Dec 23, 2024

Add ExternalDocumentationLink in abstract sink

Jira : CDAP-21093

Description

The AbstractDBSink class also throw SQLException, we also need to make the changes similar to AbstractDBSource there as well.

Ref: #530

Code change

  • Modified CloudSQLMySQLSink.java
  • Modified CloudSQLPostgreSQLSink.java
  • Modified AbstractDBSink.java
  • Modified AbstractDBSource.java
  • Modified MysqlSink.java
  • Modified PostgresSink.java

@psainics psainics added the build label Dec 23, 2024
@psainics psainics self-assigned this Dec 23, 2024
@psainics psainics force-pushed the patch/absink-getExternalDocumentationLink branch from c1663bf to 2018b92 Compare December 23, 2024 07:50
@psainics psainics marked this pull request as ready for review December 23, 2024 11:06
@psainics psainics requested a review from sahusanket December 23, 2024 11:06
@psainics psainics force-pushed the patch/absink-getExternalDocumentationLink branch from 2018b92 to 08ccb27 Compare December 27, 2024 09:33
@psainics psainics force-pushed the patch/absink-getExternalDocumentationLink branch from 08ccb27 to 5952ef7 Compare December 27, 2024 09:35
throw ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN),
e.getMessage(), errorMessageWithDetails, ErrorType.USER, false, ErrorCodeType.SQLSTATE,
e.getSQLState(), externalDocumentationLink, new SQLException(e.getMessage(),
e.getSQLState(), e.getErrorCode()));

Choose a reason for hiding this comment

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

NIT : remove space

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is auto formatted, with extra intendation since e.getSQLState(), e.getErrorCode()) is part of nested function call to new SQLException

* Override this method to provide a custom external documentation link.
*
* @return external documentation link
*/
protected String getExternalDocumentationLink() {

Choose a reason for hiding this comment

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

I think we should make this abstract and enforce the child to implement it correctly.

Returning null might cause issue if someone misses to override this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants