Repository navigation
Conversation
Newer Firebolt versions accept async SELECT queries when no result serialization is requested, so async queries are now sent with output_format=NULL. Streaming combined with async execution is rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| if async_execution: | ||
| return NULL_OUTPUT_FORMAT |
There was a problem hiding this comment.
🤖 Major: This makes every execute_async depend on the engine accepting NULL, not just async SELECT. Engines from before the async SELECT change reject the Null output format without advanced_mode ("Output format 'NULL' is not supported, choose one of: ..."). So after the SDK upgrade, async INSERT / COPY / VACUUM break against any older engine. The "Before merging" note covers staging, but not customers. Firebolt Core users pin image tags. The SDK release is not tied to the engine rollout. I see three options. We keep JSON_Compact as the default and send NULL only for SELECT (when the statement is parsed). Or we fall back to JSON_Compact on that specific format error. Or we hold the release until every supported engine and Core image has the engine change, and document the minimum version. I'd prefer one of the first two, so the SDK stays compatible with older engines.
|
|
||
| .. note:: | ||
| Fetching data via SELECT is not supported and will raise an exception. execute_async is best suited for DML queries. | ||
| Async SELECT queries are accepted, but there is currently no way to retrieve their results - execute_async is best suited for DML queries. |
There was a problem hiding this comment.
🤖 Minor: This should say from which Firebolt version async SELECT is accepted. Older engines still reject it. With this PR as is, they would reject all async queries from this SDK version (see the comment on statement_planners.py). Also, the " - " reads like a broken dash. Two sentences would be cleaner.



Summary
Newer Firebolt versions accept server-side async
SELECTqueries if the request asks for no result serialization. This PR makes the SDK sendoutput_format=NULLfor everyexecute_asynccall. Before, it sentJSON_Compact._get_output_formatreturns the newNULL_OUTPUT_FORMATconstant for async execution. This covers the fb_numeric, qmark and qmark bulk-insert planners.SELECTqueries are accepted, but their results can't be retrieved yet.test_select_async, added to both the sync and asyncio test suites.Integration tests don't run on PRs. If staging's default engine is older than the version that accepts
output_format=NULL, the async integration tests will fail, including the existing INSERT ones. Run the Integration tests FB 2.0 workflow by hand withengine-versionset to a version that supports this, and only merge once that version is on staging.Testing
🤖 Generated with Claude Code
Note
Medium Risk
Changes the HTTP contract for all
execute_asynccalls; requires a Firebolt engine version that acceptsoutput_format=NULL, or existing async integration tests will fail.Overview
Server-side
execute_asyncrequests now sendoutput_format=NULLinstead ofJSON_Compact, so newer Firebolt engines can accept asyncSELECTwhen no result serialization is requested.BaseStatementPlanner._get_output_formattakes anasync_executionflag and returns the newNULL_OUTPUT_FORMATconstant for async paths (fb_numeric, qmark, and bulk insert). Combining streaming and async now fails an assertion.Docs clarify that async
SELECTmay be submitted but results cannot be fetched yet;fetch*afterexecute_asyncstill raisesMethodNotAllowedInAsyncError. Sync/async integration tests addtest_select_async; unit tests and HTTP mocks expectNULLon async query URLs.Reviewed by Cursor Bugbot for commit eedb55f. Bugbot is set up for automated code reviews on this repo. Configure here.