Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1193,11 +1193,6 @@ public boolean isTokenFederationEnabled() {
return getParameter(DatabricksJdbcUrlParams.ENABLE_TOKEN_FEDERATION, "1").equals("1");
}

@Override
public boolean isStreamingChunkProviderEnabled() {
return getParameter(DatabricksJdbcUrlParams.ENABLE_STREAMING_CHUNK_PROVIDER).equals("1");
}

@Override
public int getLinkPrefetchWindow() {
return Integer.parseInt(getParameter(DatabricksJdbcUrlParams.LINK_PREFETCH_WINDOW));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,42 +103,31 @@ private static ChunkProvider createRemoteChunkProvider(

IDatabricksConnectionContext connectionContext = session.getConnectionContext();

if (connectionContext.isStreamingChunkProviderEnabled()) {
LOGGER.info(
"Using StreamingChunkProvider for statementId: {}", statementId.toSQLExecStatementId());

ChunkLinkFetcher linkFetcher = new SeaChunkLinkFetcher(session, statementId);
CompressionCodec compressionCodec = resultManifest.getResultCompression();
int maxChunksInMemory = connectionContext.getCloudFetchThreadPoolSize();
int linkPrefetchWindow = connectionContext.getLinkPrefetchWindow();
int chunkReadyTimeoutSeconds = connectionContext.getChunkReadyTimeoutSeconds();
double cloudFetchSpeedThreshold = connectionContext.getCloudFetchSpeedThreshold();

// Convert ExternalLinks to ChunkLinkFetchResult for the provider
ChunkLinkFetchResult initialLinks =
convertToChunkLinkFetchResult(
resultData.getExternalLinks(), resultManifest.getTotalChunkCount());

return new StreamingChunkProvider(
linkFetcher,
httpClient,
compressionCodec,
statementId,
maxChunksInMemory,
linkPrefetchWindow,
chunkReadyTimeoutSeconds,
cloudFetchSpeedThreshold,
initialLinks);
} else {
// Use the original RemoteChunkProvider
return new RemoteChunkProvider(
statementId,
resultManifest,
resultData,
session,
httpClient,
connectionContext.getCloudFetchThreadPoolSize());
}
LOGGER.info(
"Using StreamingChunkProvider for statementId: {}", statementId.toSQLExecStatementId());

ChunkLinkFetcher linkFetcher = new SeaChunkLinkFetcher(session, statementId);
CompressionCodec compressionCodec = resultManifest.getResultCompression();
int maxChunksInMemory = connectionContext.getCloudFetchThreadPoolSize();
int linkPrefetchWindow = connectionContext.getLinkPrefetchWindow();
int chunkReadyTimeoutSeconds = connectionContext.getChunkReadyTimeoutSeconds();
double cloudFetchSpeedThreshold = connectionContext.getCloudFetchSpeedThreshold();

// Convert ExternalLinks to ChunkLinkFetchResult for the provider
ChunkLinkFetchResult initialLinks =
convertToChunkLinkFetchResult(
resultData.getExternalLinks(), resultManifest.getTotalChunkCount());

return new StreamingChunkProvider(
linkFetcher,
httpClient,
compressionCodec,
statementId,
maxChunksInMemory,
linkPrefetchWindow,
chunkReadyTimeoutSeconds,
cloudFetchSpeedThreshold,
initialLinks);
}

public ArrowStreamResult(
Expand Down Expand Up @@ -193,39 +182,28 @@ private static ChunkProvider createThriftRemoteChunkProvider(
CompressionCodec compressionCodec =
CompressionCodec.getCompressionMapping(resultsResp.getResultSetMetadata());

if (connectionContext.isStreamingChunkProviderEnabled()) {
StatementId statementId = parentStatement.getStatementId();
LOGGER.info("Using StreamingChunkProvider for Thrift statementId: {}", statementId);

ChunkLinkFetcher linkFetcher = new ThriftChunkLinkFetcher(session, statementId);
int maxChunksInMemory = connectionContext.getCloudFetchThreadPoolSize();
int linkPrefetchWindow = connectionContext.getLinkPrefetchWindow();
int chunkReadyTimeoutSeconds = connectionContext.getChunkReadyTimeoutSeconds();
double cloudFetchSpeedThreshold = connectionContext.getCloudFetchSpeedThreshold();

// Convert initial Thrift links to ChunkLinkFetchResult
ChunkLinkFetchResult initialLinks = convertThriftLinksToChunkLinkFetchResult(resultsResp);

return new StreamingChunkProvider(
linkFetcher,
httpClient,
compressionCodec,
statementId,
maxChunksInMemory,
linkPrefetchWindow,
chunkReadyTimeoutSeconds,
cloudFetchSpeedThreshold,
initialLinks);
} else {
// Use the original RemoteChunkProvider
return new RemoteChunkProvider(
parentStatement,
resultsResp,
session,
httpClient,
connectionContext.getCloudFetchThreadPoolSize(),
compressionCodec);
}
StatementId statementId = parentStatement.getStatementId();
LOGGER.info("Using StreamingChunkProvider for Thrift statementId: {}", statementId);

ChunkLinkFetcher linkFetcher = new ThriftChunkLinkFetcher(session, statementId);
int maxChunksInMemory = connectionContext.getCloudFetchThreadPoolSize();
int linkPrefetchWindow = connectionContext.getLinkPrefetchWindow();
int chunkReadyTimeoutSeconds = connectionContext.getChunkReadyTimeoutSeconds();
double cloudFetchSpeedThreshold = connectionContext.getCloudFetchSpeedThreshold();

// Convert initial Thrift links to ChunkLinkFetchResult
ChunkLinkFetchResult initialLinks = convertThriftLinksToChunkLinkFetchResult(resultsResp);

return new StreamingChunkProvider(
linkFetcher,
httpClient,
compressionCodec,
statementId,
maxChunksInMemory,
linkPrefetchWindow,
chunkReadyTimeoutSeconds,
cloudFetchSpeedThreshold,
initialLinks);
}

public List<String> getArrowMetadata() throws DatabricksSQLException {
Expand Down

This file was deleted.

Loading
Loading