Skip to content

Simplify SEA disposition: use connection parameters instead of statement type#1322

Open
gopalldb wants to merge 2 commits intodatabricks:mainfrom
gopalldb:fix/sea-disposition-simplify
Open

Simplify SEA disposition: use connection parameters instead of statement type#1322
gopalldb wants to merge 2 commits intodatabricks:mainfrom
gopalldb:fix/sea-disposition-simplify

Conversation

@gopalldb
Copy link
Copy Markdown
Collaborator

Summary

The SEA result disposition (INLINE vs EXTERNAL_LINKS) was determined by statement type — only QUERY/SQL/METADATA got cloud fetch, while DML/DDL was forced to INLINE regardless of connection config. This is incorrect; disposition should be driven purely by connection parameters.

Changes

  • DatabricksSdkClient.useCloudFetchForResult(): Removed StatementType parameter. Now based solely on shouldEnableArrow() && isCloudFetchEnabled() (the EnableQueryResultDownload connection property).
  • All statement types get the same disposition based on what the user configured.

Before

private boolean useCloudFetchForResult(StatementType statementType) {
    return this.connectionContext.shouldEnableArrow()
        && (statementType == StatementType.QUERY
            || statementType == StatementType.SQL
            || statementType == StatementType.METADATA);
}

After

private boolean useCloudFetchForResult() {
    return this.connectionContext.shouldEnableArrow()
        && this.connectionContext.isCloudFetchEnabled();
}

Test plan

  • testDisposition_arrowAndCloudFetchEnabled_usesExternalLinks — verifies ARROW_STREAM format and non-INLINE disposition when both configs enabled
  • testDisposition_cloudFetchDisabled_usesInline — verifies INLINE disposition when cloud fetch is disabled
  • Full test suite + integration tests

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.

gopalldb and others added 2 commits March 26, 2026 13:16
The disposition (INLINE vs EXTERNAL_LINKS) was determined by statement
type (QUERY/SQL/METADATA got cloud fetch, others got inline). This is
wrong — disposition should be driven by connection parameters only:
- shouldEnableArrow() — whether Arrow format is enabled
- isCloudFetchEnabled() — whether cloud fetch (EnableQueryResultDownload)
  is enabled

Removed the statementType-based branching in useCloudFetchForResult().
Now all statement types get the same disposition based on connection
config, which is the correct behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
- Test arrow+cloudFetch enabled: verifies disposition is not INLINE
  and format is ARROW_STREAM
- Test cloudFetch disabled: verifies the condition resolves to INLINE
  (arrow enabled but cloud fetch disabled)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Gopal Lal <gopal.lal@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants