Skip to content

fix(results): fetch paged results with CloudFetch disabled - #436

Merged
aakash-saravanan-db merged 15 commits into
mainfrom
aakash-saravanan_data/fix/cloudfetch-disabled
Nov 12, 2026
Merged

aakash-saravanan-db merged 15 commits into
mainfrom
aakash-saravanan_data/fix/cloudfetch-disabled

Conversation

@aakash-saravanan-db

@aakash-saravanan-db aakash-saravanan-db commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Setting the existing ResultConfig.cloudfetch_enabled option to false currently makes queries fail because the kernel requests an unsupported inline Arrow format. Applications that cannot access cloud storage therefore cannot fetch their results.

This PR applies the option when opening the session and keeps the result format that supports multiple inline pages. Applications can consume the complete result through the SQL connection, including large results. An explicit disable takes precedence over conflicting settings, and the kernel rejects unexpected storage links before downloading them.

Server dependency: The warehouse must support paged inline Arrow results. A warehouse that does not support this capability returns its configuration error to the caller.

Validation: Kernel tests, formatting, and Clippy pass. Wire tests cover option precedence, initial and continuation responses, pagination offsets, and missing upfront result totals. A locally built Rust ADBC driver fetched all 250,000 rows and 32 MB of payload with the expected result hash and zero storage downloads. Enabled delivery, query errors, session reuse, and close also passed.

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 2 Medium

The change looks mostly right but has two medium concerns. With CloudFetch disabled, the client no longer does anything itself to keep results off cloud storage: it relies entirely on the server honouring can_cloud_download, and that key can be overridden by a caller's differently-cased copy. Several docs, including the public C header, still describe the old INLINE behaviour.

Comment thread src/client/sea.rs Resolved
Comment thread src/client/sea.rs Resolved
…edence

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good overall, with one low-severity inconsistency in error codes. The session-level can_cloud_download=false override is applied on the only CreateSession path (src/client/sea.rs), the reader's CloudFetchConfig.enabled is wired from ResultConfig.cloudfetch_enabled, and the new wiremock tests cover paged continuation, rejected external links, and unsupported-server errors. Nit: the Transport chunk-fetch doc (src/client/transport.rs ~L393) still says the inline streaming path only "lights up when cloudfetch_enabled == false"; it now also serves paged inline results when CloudFetch is enabled.

Comment thread src/reader/mod.rs Resolved
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 2 Low

The change looks correct, with two low-severity notes. Turning CloudFetch off now sends can_cloud_download=false on CreateSession and keeps paged Arrow delivery. The reader rejects external_links without downloading them, and the wiremock tests cover continuation chunks and the error from servers that don't support it. The notes are the error category for that rejection and a C-ABI test that no longer checks the setting actually changes what goes over the wire.

Comment thread src/reader/mod.rs Resolved
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 2 Low

The approach looks right: can_cloud_download=false is sent at session open and overrides any caller-supplied value, and a client-side guard rejects any cloud-storage links the server returns anyway. Tests cover inline paging with row offsets, missing row/chunk totals, and the guard. I found two low-severity issues: the error category the guard uses, and a README that doesn't mention the warehouse-support requirement.

Comment thread src/reader/mod.rs Resolved
Comment thread adbc/README.md Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low · 1 Nit

The change looks correct, with two low-severity notes. With CloudFetch disabled, the kernel now always sends INLINE_OR_EXTERNAL_LINKS and forces can_cloud_download=false at CreateSession, replacing any caller-supplied value regardless of letter case. It also refuses to download if the server returns cloud-storage links anyway. Wiremock tests cover the paged continuation, the link rejection and the unsupported-server error, and there is a live E2E test.

Other findings

  • ⚪ Nit — This message was reworded for the new mode, and it still embeds the whole raw response body (String::from_utf8_lossy(&body)). The error fires exactly when the server sent back a CloudFetch response instead of inline data, so that body will normally contain external_links[].external_link: presigned, credential-bearing URLs. Those URLs then land in the error message, which callers and loggers commonly surface in full.

This is not new, but the PR now makes the path reachable in a mode intended for environments that cannot use cloud storage. Consider logging only the response's keys or a redacted summary instead of the raw body.

Comment thread src/reader/mod.rs Resolved
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good, with one low-severity note about which error category the new external-links guard uses. The paged-inline switch (session-level can_cloud_download=false, keeping INLINE_OR_EXTERNAL_LINKS) has tests at the right levels: wiremock for continuation offsets, case-insensitive override and error passthrough, a C-ABI check, and a live #[ignore] E2E test; the docs were updated to match.

Comment thread src/reader/mod.rs Resolved
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good, with one low concern about the error category. Disabling CloudFetch now sends can_cloud_download=false at session open (overriding the caller's value, with case-insensitive dedup) and keeps the paged Arrow disposition. The reader refuses external links without downloading them, and the chunk error message no longer echoes the response body, so presigned URLs don't leak. Wiremock and e2e tests cover these changes.

Comment thread src/reader/mod.rs Resolved

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

… channels

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good. There is one low-severity concern: when a typed cloudfetch_enabled = false overrides a session_conf value of true, nothing tells the user. The new approach (keep INLINE_OR_EXTERNAL_LINKS and send can_cloud_download=false when creating the session) is applied consistently. External links are rejected when they arrive in the first response and in continuation responses, and both cases have wiremock tests. Signed URLs no longer show up in error messages.

Comment thread src/session.rs Resolved
…stics

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: 1 Low

Looks good, with one low-severity stale comment. The new mechanism is consistent across transport, config precedence, and the reader guard. It sends can_cloud_download=false on CreateSession, always uses INLINE_OR_EXTERNAL_LINKS, and rejects external links when CloudFetch is disabled. Wiremock tests cover continuation pages, the leak-free error, and preservation of server errors.

Comment thread src/session.rs Resolved
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
…-kernel into fix/cloudfetch-disabled

Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

This branch was previously deployed

1 inactive deployment
azure-prod — 0b5d0edf Deployed Nov 11, 2026 by oss-reviewer-bot[bot] via followup #2420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants