Repository navigation
Surface truncated flag from SEA result manifest - #1351
tom-s-powell wants to merge 8 commits into
Conversation
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.
| 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.
|
Can you please sync the branch from main? |
|
This PR has been marked as Stale because it has been open for 30 days with no activity. If you would like the PR to remain open, please remove the stale label or comment on the PR. |
## Summary - Propagate the `truncated` field from the SEA `ResultManifest` into `DatabricksResultSetMetaData` via a new `getIsTruncated()` accessor, allowing callers to detect when query results have been truncated by the server. - Defaults to `false` for all Thrift and non-SEA code paths. - Based on community contribution from PR #1351 by @tom-s-powell — applied cleanly on latest `main` with all errors resolved. ## Test plan - [x] Unit test `testSdkTruncated` covers null, true, and false values from the manifest - [x] Existing `testGetDispositionThrift` extended to assert `getIsTruncated() == false` for Thrift paths - [x] Integration tests (`SqlExecApiHybridResultsIntegrationTests`) assert `getIsTruncated() == false` for both inline and CloudFetch hybrid result paths - [x] All tests pass locally NO_CHANGELOG=true This pull request was co-authored by Isaac. Signed-off-by: Gopal Lal <[email protected]> Co-authored-by: Thomas Powell <[email protected]>
|
This PR has been merged as: #1503 |
Pull request was closed
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.
NO_CHANGELOG=true