Surface truncated flag from SEA result manifest#1351
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. |
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.