Repository navigation
[PECOBLR-620] Fixed byteBufferToString function and added unit tests - #908
Merged
Merged
Conversation
…abricks Connection
jprakash-db
reviewed
Jul 24, 2025
|
|
||
| throw new DatabricksSQLFeatureNotImplementedException( | ||
| "Not implemented in DatabricksConnection - createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)"); | ||
| if (resultSetType != ResultSet.TYPE_FORWARD_ONLY |
Collaborator
There was a problem hiding this comment.
Not related to this PR, create a new PR
| @@ -56,8 +56,14 @@ public static TNamespace getNamespace(String catalog, String schema) { | |||
|
|
|||
| public static String byteBufferToString(ByteBuffer buffer) { | |||
Collaborator
There was a problem hiding this comment.
Write tests that show the difference between the previous and new approach
madhav-db
reviewed
Jul 25, 2025
| ByteBuffer newBuffer = buffer.duplicate(); // This is to avoid a BufferUnderflowException | ||
| long sigBits = newBuffer.getLong(); | ||
| return new UUID(sigBits, sigBits).toString(); | ||
| if (newBuffer.remaining() >= 16) { |
Collaborator
There was a problem hiding this comment.
+1. add in DatabricksJdbcConstants
shivam2680
self-requested a review
July 25, 2025 07:28
madhav-db
approved these changes
Jul 25, 2025
shivam2680
reviewed
Jul 25, 2025
| ByteBuffer newBuffer = buffer.duplicate(); // This is to avoid a BufferUnderflowException | ||
| long sigBits = newBuffer.getLong(); | ||
| return new UUID(sigBits, sigBits).toString(); | ||
| if (newBuffer.remaining() >= 16) { |
Collaborator
There was a problem hiding this comment.
Add comments for cases where buffer does have 16 bytes. For example, we saw in sessionId
Contributor
|
Congratulations for your first PR! Thanks, and here's to many more! 🥂 |
shivam2680
reviewed
Jul 25, 2025
| LOGGER.debug( | ||
| "getOperationHandle {%s} for statementId {%s}", | ||
| statementId, byteBufferToString(identifier.guid)); | ||
| LOGGER.debug("getOperationHandle for statementId {%s}", statementId); |
Collaborator
There was a problem hiding this comment.
better to print just the statement id generated. Why are printing the whole object here?
1 of 3 tasks
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]>
eric-wang-1990
added a commit
that referenced
this pull request
Jul 24, 2026
## Summary Wires **databricks-jdbc** into the databricks-driver-test test platform with two independent senders: ### 1. Coverage fan-out (`trigger-coverage-fanout.yml`) On a merged PR to `main` that touched JDBC driver source (`src/main/`), dispatch `coverage-fanout` to driver-test → opens a tracking issue + runs the language-agnostic multi-language coverage fan-out (spec authored from the PR diff, conformed across every driver). ### 2. Integration-test PR gate (`trigger-integration-tests.yml`) — **replay only** Per-PR gate matching the sql-go / adbc-csharp senders, but **replay-only by design** — we never trigger a live E2E run from a PR (slow, flaky, would block landing). On a label / merge-queue event, dispatch `jdbc-pr-test` to driver-test with `proxy_mode=replay`: driver-test builds the driver at **this PR's commit** and serves committed recordings (no credentials, no warehouse), reporting a **"JDBC Integration Tests"** check back. - `integration-test` label → Thrift replay preview · `integration-test-sea` → SEA replay preview - merge-queue → required Thrift-replay gate - `remove-label-on-new-commit` re-review guard + green skip-stub on ordinary PRs ## Dependencies (both admin/cross-repo) 1. **Receiver PR** databricks/databricks-driver-test#908 adds `proxy_mode=replay` to `jdbc-integration-tests.yml`. **Must merge for the integration-test gate to run replay** (without it the receiver ignores proxy_mode). 2. **`INTEGRATION_TEST_APP_ID` / `INTEGRATION_TEST_PRIVATE_KEY` secrets** must be added to `databricks-jdbc` (the same App the other driver repos use) — required for BOTH senders' token mint. Until then the dispatch steps fail and no dispatch is sent (workflows otherwise inert). 3. The App must be installed on `databricks-jdbc` with `checks: write` so driver-test can report the "JDBC Integration Tests" check back. ## Test Plan - [x] Both workflows validate (YAML + job-guard review). - [ ] After secrets + #908: a databricks-jdbc PR with `integration-test` shows a "JDBC Integration Tests" check running in replay against the PR commit; merge-queue runs the required Thrift-replay gate. - [ ] A merged `src/main/` PR dispatches `coverage-fanout` + opens a tracking issue in driver-test. This pull request and its description were written by Isaac. <!-- CI/workflow-only change; no user-facing driver behavior. --> NO_CHANGELOG=true --------- Signed-off-by: Eric Wang <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed byteBufferToString function: The function assumed the byteBuffer size to be a Long and resulted in buggy output for size 16. This resulted in buggy value of sessionId and some logging statements.
Removed the extra logged statementId.
Testing
Related tickets:
PECOBLR-620
NO_CHANGELOG=true