SNOW-3449105 add Reset for ArrowStreamBatch method (mirror of #1782)#1792
Merged
Conversation
Run ci/gofix.sh CI check expects []byte(fmt.Sprintf(...)) to be rewritten as fmt.Appendf(nil, ...). Co-authored-by: davidhcoe <13318837+davidhcoe@users.noreply.github.com>
c939d64 to
2bdeb66
Compare
sfc-gh-dheyman
approved these changes
May 13, 2026
Master (#1795/#1796) added a body-only newTestArrowStreamBatch in arrow_stream_test.go that collided with the funcGet-based helper introduced by this PR in arrow_test.go. Keep the funcGet helper since it's a strict superset (lets tests control status code, error returns, and per-call body) and adapt master's body-only call sites via a new static200OK helper. Co-authored-by: davidhcoe <13318837+davidhcoe@users.noreply.github.com>
After master added the cancelableStream wrapper around GetStream's return value, asserting pointer identity against the cached rr no longer holds. Read from the returned stream and assert its bytes match the cached reader's payload — that's the behavior the test actually cares about. Co-authored-by: davidhcoe <13318837+davidhcoe@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
ArrowStreamBatch.Reset()so callers can retry a chunk download after a mid-stream failure (e.g. a TCP RST from cloud storage) without re-executing the whole query.Addresses #1781: customers using ADBC → goSnowflake from Power BI hit
arrow/ipc: could not read message body: ... An existing connection was forcibly closed by the remote host.mid-stream during long Arrow reads. The TCP reset happens on the chunk download connection to S3/Azure Blob, soClientSessionKeepAlivedoesn't help — it keeps the Snowflake control-plane session alive, not the chunk transfer. Without a way to clear the cached reader, the only recovery path was re-executing the query.Reset()closes the in-flight reader and nils out the cachedrr, so the nextGetStream()triggers a fresh chunk download (or, for inlineRowSetBase64batches, restores the inline reader frominlineData). The mid-read failure becomes a recoverable retry instead of a query-level redo.Checklist
Mirror of #1782 by @davidhcoe.
Co-authored-by: davidhcoe 13318837+davidhcoe@users.noreply.github.com