Surface truncated flag from SEA result manifest#1351
Open
tom-s-powell wants to merge 4 commits intodatabricks:mainfrom
Open
Surface truncated flag from SEA result manifest#1351tom-s-powell wants to merge 4 commits intodatabricks:mainfrom
tom-s-powell wants to merge 4 commits intodatabricks:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR surfaces the SEA result manifest’s truncated flag through DatabricksResultSetMetaData so JDBC consumers can detect when SEA results are incomplete/truncated (similar to isCloudFetchUsed).
Changes:
- Add
truncatedstate toDatabricksResultSetMetaDataand expose it viagetIsTruncated(). - Populate
truncatedfrom SEAResultManifest.getTruncated()(defaulting tofalsewhen unset). - Add/extend unit + integration tests to assert
getIsTruncated()behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/main/java/com/databricks/jdbc/api/impl/DatabricksResultSetMetaData.java |
Adds truncated metadata field/getter and initializes it from SEA result manifests. |
src/test/java/com/databricks/jdbc/api/impl/DatabricksResultSetMetaDataTest.java |
Adds unit coverage for SDK/SEA manifest truncated being null/true/false. |
src/test/java/com/databricks/jdbc/integration/fakeservice/tests/SqlExecApiHybridResultsIntegrationTests.java |
Extends integration assertions to ensure hybrid SEA results are not marked truncated. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/databricks/jdbc/api/impl/DatabricksResultSetMetaData.java
Outdated
Show resolved
Hide resolved
src/main/java/com/databricks/jdbc/api/impl/DatabricksResultSetMetaData.java
Outdated
Show resolved
Hide resolved
Comment on lines
502
to
509
| this.statementId = statementId; | ||
| this.isCloudFetchUsed = false; | ||
| this.totalRows = -1; | ||
| this.chunkCount = -1L; | ||
| this.columns = columnsBuilder.build(); | ||
| this.columnNameIndex = CaseInsensitiveImmutableMap.copyOf(columnNameToIndexMap); | ||
| this.truncated = false; | ||
| } |
There was a problem hiding this comment.
This constructor now sets chunkCount to -1L. Since chunkCount is only used as nullable metadata (e.g., telemetry’s total_chunks_present), using null for "not applicable" avoids negative values showing up in logs/metrics.
src/main/java/com/databricks/jdbc/api/impl/DatabricksResultSetMetaData.java
Outdated
Show resolved
Hide resolved
src/main/java/com/databricks/jdbc/api/impl/DatabricksResultSetMetaData.java
Outdated
Show resolved
Hide resolved
gopalldb
approved these changes
Mar 30, 2026
Collaborator
|
Can you please sync the branch from main? |
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
When using SEA it would be helpful to understand whether results have been truncated to ensure we don't silently consume incomplete results. Propagating this flag into
DatabricksResultSetMetaDatasimilar toisCloudFetchUsedwould be helpful.I guess in theory the JDBC driver could fail loudly if results are truncated, but appreciate that's a behaviour change and perhaps use of SEA is expected to match behaviour via the API and it's a user's responsibility to behave appropriately.
Testing
Unit tests have been added.