GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Adhoc query fixes by gz · Pull Request #6244 · feldera/feldera

Conversation

@gz

@gz gz commented May 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
Scenario fda v0.296.0 PR fda
SELECT 1/0 (text) exits 0, scripts blind exits 1, single ERROR line
SELECT * FROM not_materialized exits 0 exits 1
SELECT 1/0 (arrow_ipc) exits 1 already exits 1 (unchanged)
Parser error message sql parser error: ... at Line: 1, Column: 37 non-debug fmt error msg
INSERT;INSERT;SELECT server-side rejected before this branch allowed
SELECT 1; SELECT 2 server-side rejected with strange error rejected with clearer "only the final statement may return a result set" message
--format json invocation no warning stderr deprecation warning pointing at arrow_ipc
  • Fixes [adapters] Ad hoc queries return errors with HTTP status 200 #4973
  • Fixes [adhoc] Output error location when a query cannot be parsed. #2526
  • Fixes Deprecate the JSON format for ad-hoc queries #4219
  • Fixes Switch python-sdk use the arrow-ipc format instead of JSON #3923
  • Fixes [ad-hoc] fda queries do not produce results with multiple columns with the same name #4218
  • Fixes fda query should be able to execute multiple statements #2487

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gz
gz requested a review from mihaibudiu May 15, 2026 05:58
mihaibudiu
mihaibudiu approved these changes May 15, 2026
View reviewed changes
Comment thread crates/adapters/src/adhoc.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/adapters/src/adhoc.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/adapters/src/adhoc.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/adapters/src/adhoc.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/adapters/src/adhoc.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread python/feldera/rest/feldera_client.py
:param query: The SQL query to be executed.
:return: A generator that yields each row of the result as a Python dictionary, deserialized from JSON.
"""
"""Internal JSON streaming used by both `query_as_json` and the

@mihaibudiu mihaibudiu May 15, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can you file an issue that we migrate all users to the new format?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread python/feldera/rest/feldera_client.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread python/tests/runtime/test_adhoc_queries.py Outdated
self.pipeline.query(
"INSERT INTO t1 VALUES "
"(200,'2020-02-02','11111111-1111-1111-1111-111111111111');"
"INSERT INTO t1 VALUES "

@mihaibudiu mihaibudiu May 15, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I guess no DELETE yet?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread python/tests/runtime/test_adhoc_queries.py

Wide integers (``BIGINT``) and high-precision decimals are the
cases the deprecated JSON path mishandles; we assert the values
come back exactly. Types ``ROW``, ``VARIANT``, and ``INTERVAL``

@mihaibudiu mihaibudiu May 15, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Apparently MAP too

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread python/tests/runtime/test_adhoc_queries.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

mythical-fred
mythical-fred approved these changes May 15, 2026
View reviewed changes

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM — thorough work closing six issues. One nit inline.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread crates/adapters/src/adhoc.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gz
gz force-pushed the adhoc-query-fixes branch from c2560de to 19c5e73 Compare May 15, 2026 17:42
@gz
gz enabled auto-merge May 15, 2026 17:43
@gz
gz added this pull request to the merge queue May 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 15, 2026

Uh oh!

There was an error while loading. Please reload this page.

gz added 3 commits May 15, 2026 20:20
@gz
fda: exit non-zero when WS adhoc query closes with error
5938c55
A query that fails during execution (e.g. division by zero, querying a
non-materialized table) cannot use HTTP status codes to signal failure
in streaming mode because the response headers are already sent.

WebSocket mode closes with `CloseCode::Error` plus a preceding text
frame carrying the error details, but the fda client only logged a
warning and left the exit code at 0, hiding the failure from scripts.

Fixes #4973
@gz
adhoc: clean up parser error message and surface location
41e11e6
DataFusion's SQL parser wraps the underlying `sqlparser::ParserError`
in a `DataFusionError::Diagnostic(DataFusionError::SQL(...))`. The
default `Display` chain printed it through `Debug` and the user saw

  Error during query processing: SQL error: ParserError("Expected: end of
  statement, found: in at Line: 1, Column: 30").

The line/column was buried inside the quoted `Debug` form, and the
`SQL error: ParserError(...)` wrapper added noise.

Unwrap the `Diagnostic` and use the parser's `Display` impl, which
already appends `at Line: X, Column: Y`, producing

  Error during query processing: sql parser error: Expected: end of
  statement, found: in at Line: 1, Column: 30.

Fixes #2526
@gz
adhoc: add Arrow IPC client APIs and deprecate the JSON format
99ddae2
JSON is lossy: it coerces wide integers to f64, cannot represent SQL
`MAP` keys that are not strings, and silently drops result columns
that share a name. Arrow IPC does not have these limitations and is
already used internally by fda for tabular display.

Python:
- Add `pyarrow` as a runtime dependency.
- Add `FelderaClient.query_as_arrow_ipc` and the matching
  `Pipeline.query_arrow_ipc` helper that yield `pyarrow.RecordBatch`
  objects over an HTTP stream from the `/query` endpoint.
- Extract the JSON streaming loop into a private
  `_query_json_stream` so `Pipeline.query()` can keep its existing
  dict-based contract without emitting a DeprecationWarning to user
  code that has not migrated yet.
- Emit a `DeprecationWarning` from `FelderaClient.query_as_json` so
  external callers are nudged toward the Arrow IPC path.

fda:
- Promote the JSON deprecation notice to a stderr warning so it is
  visible without enabling `log`-level configuration.

Tests:
- Cover the duplicate-column case from
  #4218 with an Arrow IPC
  round-trip that requires both `x` columns to survive.
- Cover wide-integer fidelity (2**53 + 1) and the common primitive
  SQL types via Arrow IPC.
- Add an `fda --format arrow_ipc query` smoke run to test.bash.

Fixes #4219
Fixex #3923
Fixes #4218
@gz
gz force-pushed the adhoc-query-fixes branch 2 times, most recently from d69ad87 to 57a0f24 Compare May 16, 2026 06:23
@gz
gz enabled auto-merge May 16, 2026 06:24
@gz
adhoc: allow non-PREPARE intermediate statements in multi-statement q…
f241edf
…ueries

Previously `execute_sql_with_state` rejected any non-PREPARE
statement before the final statement, so submitting
`INSERT; INSERT; SELECT` or even two INSERTs in a row required
splitting them into separate requests.

Relax that restriction: an intermediate non-result-producing
statement (DML or a DataFusion `Statement` variant such as a
prepared EXECUTE) is now executed for its side effect, its row
count is discarded, and the final statement still owns the
streaming protocol's single result slot.

A result-producing statement (SELECT and other relational
operators) in a non-final position is still rejected.
Will need to add come up with a streaming protocol to support
this.

Fixes #2487

Signed-off-by: Gerd Zellweger <[email protected]>
@gz
gz force-pushed the adhoc-query-fixes branch from 57a0f24 to f241edf Compare May 16, 2026 06:25
@feldera-bot
[ci] apply automatic fixes
2a5cdc1
Signed-off-by: feldera-bot <[email protected]>
@gz
gz added this pull request to the merge queue May 16, 2026
Merged via the queue into main with commit b8e2c8b May 16, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@gz
gz deleted the adhoc-query-fixes branch May 16, 2026 10:53
@mythical-fred mythical-fred mentioned this pull request May 22, 2026
[adapters] Revert read-after-write semantics in ad hoc queries. #6303
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mihaibudiu mihaibudiu mihaibudiu approved these changes
+1 more reviewer
@mythical-fred mythical-fred mythical-fred approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Deprecate the JSON format for ad-hoc queries [ad-hoc] fda queries do not produce results with multiple columns with the same name Switch python-sdk use the arrow-ipc format instead of JSON [adhoc] Output error location when a query cannot be parsed. fda query should be able to execute multiple statements
[adapters] Ad hoc queries return errors with HTTP status 200

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@gz @mihaibudiu @mythical-fred @feldera-bot
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.