Skip to content

[PECOBLR-595] Add vendor codes for incorrect token and host - #910

Merged
vikrantpuppala merged 15 commits into
databricks:mainfrom
vikrantpuppala:error-codes-2
Jul 24, 2025
Merged

vikrantpuppala merged 15 commits into
databricks:mainfrom
vikrantpuppala:error-codes-2

Conversation

@vikrantpuppala

@vikrantpuppala vikrantpuppala commented Jul 24, 2025 •

Copy link
Copy Markdown
Collaborator

Description

This PR enhances vendor code functionality by adding automatic vendor code detection from error messages and host information. The changes refactor the existing vendor code system to support dynamic code extraction from exceptions while maintaining compatibility with existing error handling.

Refactors DatabricksVendorCodes to DatabricksVendorCode with enhanced pattern matching capabilities
Adds automatic vendor code detection for incorrect tokens and hosts based on exception messages
Updates exception constructors to automatically extract vendor codes from throwable chains

Testing

Unit + manual testing

Additional Notes to the Reviewer

Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
…r-codes-2

# Conflicts:
#	src/main/java/com/databricks/jdbc/common/util/ValidationUtil.java
#	src/main/java/com/databricks/jdbc/exception/DatabricksSQLException.java
#	src/main/java/com/databricks/jdbc/exception/DatabricksValidationException.java
#	src/test/java/com/databricks/jdbc/api/impl/DatabricksConnectionContextTest.java
@vikrantpuppala
vikrantpuppala requested a review from Copilot July 24, 2025 12:25

This comment was marked as outdated.

Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>
@vikrantpuppala
vikrantpuppala requested a review from Copilot July 24, 2025 12:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances vendor code functionality by adding automatic vendor code detection from error messages and host information. The changes refactor the existing vendor code system to support dynamic code extraction from exceptions while maintaining compatibility with existing error handling.

  • Refactors DatabricksVendorCodes to DatabricksVendorCode with enhanced pattern matching capabilities
  • Adds automatic vendor code detection for incorrect tokens and hosts based on exception messages
  • Updates exception constructors to automatically extract vendor codes from throwable chains

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/java/com/databricks/jdbc/exception/DatabricksVendorCode.java Complete refactor with new pattern matching methods for vendor code detection
src/main/java/com/databricks/jdbc/exception/DatabricksSQLException.java Updated constructors to automatically extract vendor codes from exceptions
src/main/java/com/databricks/jdbc/common/util/ValidationUtil.java Updated import references and enhanced HTTP error handling with JSON parsing
src/main/java/com/databricks/jdbc/exception/DatabricksValidationException.java Removed unused constructor overload
src/main/java/com/databricks/jdbc/dbclient/impl/thrift/DatabricksHttpTTransport.java Modified to pass original exception instead of error message
src/main/java/com/databricks/jdbc/common/error/DatabricksVendorCodes.java Deleted old vendor codes class
src/test/java/com/databricks/jdbc/exception/DatabricksVendorCodeTest.java Comprehensive test suite for new vendor code detection functionality
src/test/java/com/databricks/jdbc/api/impl/DatabricksConnectionContextTest.java Updated import references to new vendor code class

Signed-off-by: Vikrant Puppala <[email protected]>
Signed-off-by: Vikrant Puppala <[email protected]>

@jprakash-db jprakash-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Thanks for making the changes

@vikrantpuppala
vikrantpuppala merged commit 57e9fab into databricks:main Jul 24, 2025
@vikrantpuppala vikrantpuppala changed the title Add vendor codes for incorrect token and host [PECOBLR-595] Add vendor codes for incorrect token and host Jul 24, 2025
eric-wang-1990 added a commit that referenced this pull request Jul 24, 2026
Align the JDBC integration-test sender with design #910: the sender no longer
picks a backend. Both dispatch paths (the single `integration-test` label
preview and the merge-queue required gate) send one payload —
{pr_number, commit_sha, pr_repo, pr_url, proxy_mode: 'replay'} — and driver-test's
receiver runs the full replay matrix (thrift + sea), reporting one aggregated
"JDBC Integration Tests" check.

- Drop the `integration-test-sea` label and the label→jdbc_mode resolution;
  one `integration-test` label now previews the full replay run.
- Remove jdbc_mode from both dispatch payloads.
- SEA is now part of the required merge-queue gate (was preview-only), since the
  receiver runs both backends.

Pairs with the receiver change (databricks-driver-test #908) that computes the
backend matrix and aggregates the check.

Co-authored-by: Isaac
Signed-off-by: Eric Wang <[email protected]>
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