Skip to content

Commit 26823e3

Browse files
committed
Stop depending on manifest.total_chunk_count in bounded SEA CloudFetch path
Per the bounded SEA API contract, drivers must not depend on manifest.{chunks, total_chunk_count, total_row_count}. Pass null for totalChunkCount when converting initial ExternalLinks for StreamingChunkProvider — the provider derives end-of-stream from next_chunk_index on ExternalLink instead. Signed-off-by: Gopal Lal <gopal.lal@databricks.com> Co-authored-by: Isaac Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
1 parent 7e0b2c1 commit 26823e3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/com/databricks/jdbc/api/impl/arrow/ArrowStreamResult.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,13 @@ private static ChunkProvider createRemoteChunkProvider(
115115
int chunkReadyTimeoutSeconds = connectionContext.getChunkReadyTimeoutSeconds();
116116
double cloudFetchSpeedThreshold = connectionContext.getCloudFetchSpeedThreshold();
117117

118-
// Convert ExternalLinks to ChunkLinkFetchResult for the provider
118+
// Convert ExternalLinks to ChunkLinkFetchResult for the provider.
119+
// Bounded SEA API: pass null for totalChunkCount — we must not depend on
120+
// manifest.{chunks, total_chunk_count, total_row_count} per the bounded API contract.
121+
Long totalChunkCount =
122+
connectionContext.isBoundedSeaApiEnabled() ? null : resultManifest.getTotalChunkCount();
119123
ChunkLinkFetchResult initialLinks =
120-
convertToChunkLinkFetchResult(
121-
resultData.getExternalLinks(), resultManifest.getTotalChunkCount());
124+
convertToChunkLinkFetchResult(resultData.getExternalLinks(), totalChunkCount);
122125

123126
return new StreamingChunkProvider(
124127
linkFetcher,

0 commit comments

Comments
 (0)