Skip to content

fix(go): resolve intermittent EOF errors fetching large results (#192)#194

Merged
lidavidm merged 3 commits intomainfrom
stack/githud_192
Jan 28, 2026
Merged

fix(go): resolve intermittent EOF errors fetching large results (#192)#194
lidavidm merged 3 commits intomainfrom
stack/githud_192

Conversation

@jadewang-db
Copy link
Collaborator

@jadewang-db jadewang-db commented Jan 28, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Fix intermittent "arrow/ipc: could not read continuation indicator: EOF"
errors when fetching large result sets (30M+ rows) from Databricks.

Root cause: The code called SchemaBytes() before any data fetch. In
databricks-sql-go, when query results are large (no "direct results"
in the response), the schema is populated lazily during the first
Next() call. Calling SchemaBytes() before Next() returned empty bytes,
causing the Arrow IPC reader to fail with EOF.

The fix changes the initialization order to:

  1. First call loadNextReader() which triggers data fetch
  2. Get schema from the loaded IPC reader (which always has schema)
  3. Fall back to SchemaBytes() only for empty result sets

Fixes: #192

Co-Authored-By: Claude (databricks-claude-opus-4-5) noreply@anthropic.com

Fix intermittent "arrow/ipc: could not read continuation indicator: EOF"
errors when fetching large result sets (30M+ rows) from Databricks.

Root cause: The code called SchemaBytes() before any data fetch. In
databricks-sql-go, when query results are large (no "direct results"
in the response), the schema is populated lazily during the first
Next() call. Calling SchemaBytes() before Next() returned empty bytes,
causing the Arrow IPC reader to fail with EOF.

The fix changes the initialization order to:
1. First call loadNextReader() which triggers data fetch
2. Get schema from the loaded IPC reader (which always has schema)
3. Fall back to SchemaBytes() only for empty result sets

Fixes: #192

Co-Authored-By: Claude (databricks-claude-opus-4-5) <noreply@anthropic.com>
When custom TLS configuration is needed (sslCertPool or sslInsecure),
the driver was creating a bare-bones http.Transport with only TLS
settings, overriding databricks-sql-go's well-configured defaults.

This could cause timeout issues during large result set downloads
because the custom transport lacked:
- Dial timeout and keep-alive settings
- Idle connection timeout
- Connection pool configuration

Now the custom transport includes all the same settings as
databricks-sql-go's PooledTransport:
- DialTimeout: 30s
- KeepAlive: 30s
- IdleConnTimeout: 180s
- TLSHandshakeTimeout: 10s
- Connection pooling (MaxIdleConns: 100, MaxConnsPerHost: 100)

These are sensible defaults matching the upstream library. Configuration
options for these values can be added in a future PR if needed.

Note: There is a separate upstream issue in databricks-sql-go where
CloudFetch uses http.DefaultClient with no timeouts. That should be
reported/fixed in the databricks-sql-go repository.

Related to: #192

Co-Authored-By: Claude (databricks-claude-opus-4-5) <noreply@anthropic.com>
@lidavidm
Copy link
Contributor

I'll update the test.

@lidavidm lidavidm merged commit 6890ee8 into main Jan 28, 2026
22 checks passed
@lidavidm lidavidm deleted the stack/githud_192 branch January 28, 2026 02:18
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.

[Go] Intermittent timeouts and EOF errors fetching large result

2 participants