You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_duckdb_jdbc_fetch misses HasError() check after Fetch(), causing silent result truncation on streaming queries #893
Bug Description
When streaming results via the JDBC driver, a query failure mid-execution (e.g., synthetic data error, mid-stream S3 network drop, or corrupt Parquet chunk) is silently masked as end-of-stream (EOF).
Rather than throwing a SQLException, ResultSet.next() returns false, causing calling applications to receive partial data silently (e.g., returning 29M rows out of 40M without any warning or exception).
Root Cause Analysis
In core DuckDB C++, FetchInternal returns a null chunk both when data ends naturally and when execution encounters an error. Upon failure, it sets the error state on the result object for the caller to check via HasError().
In the Java native driver (duckdb_java.cpp, _duckdb_jdbc_fetch), HasError() is checked before invoking Fetch(), but not after.
When Fetch() returns null due to a mid-stream failure, _duckdb_jdbc_fetch replaces it with an empty chunk.
In DuckDBResultSet.next(), receiving an empty chunk is treated as finished = true, returning false to the caller.
Expected Behavior
If Fetch() yields a null chunk and HasError() returns true, _duckdb_jdbc_fetch / DuckDBResultSet should extract the error message and throw a SQLException.
Activity
staticlibs commentedon Oct 4, 2026
Hi, thanks for the report! I believe this was fixed in #886. It can be checked with the following snapshot:
rigobc commentedon Oct 4, 2026
great - thank you!