risingwavelabs/risingwave · error · ErrorCode::DataFusionError
DataFusion error
Error message
DataFusion error: {0} What it means
`ErrorCode::DataFusionError` converts `datafusion_common::DataFusionError` via `#[from]`. It appears only with the `datafusion` feature and wraps failures from the embedded DataFusion engine (used for batch query acceleration), preserving DataFusion's own error kind.
Solutions
- Read the wrapped DataFusion message to identify the failing phase
- Rewrite the query to avoid the unsupported construct or force the non-DataFusion path
- Verify table schema matches the data being scanned
- Check RisingWave release notes for DataFusion-related changes
Defensive patterns
Strategy: fallback
Validate before calling
null
Type guard
fn is_datafusion_error(e: &RwError) -> bool { matches!(e.get_code(), ErrorCode::DataFusionError(_)) } Try / catch
match err.get_code() { ErrorCode::DataFusionError(inner) => { log::warn!("datafusion failed: {inner}"); run_via_default_engine(query); }, _ => propagate } Prevention
- Keep queries within the subset supported by the DataFusion path
- Pin and test RisingWave versions against your query suite
- Watch for schema drift between catalog and scanned data
- Disable/enable the acceleration path explicitly when debugging
When it happens
Trigger: Running a batch query through the DataFusion path: unsupported SQL pushdown, DataFusion planning failures, or DataFusion execution errors (e.g. invalid cast, missing column in a scanned parquet/table).
Common situations: Query features DataFusion can't plan but the standard frontend accepted, schema drift between catalog and underlying data, DataFusion version-specific behavior after upgrade.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/3f8a522170acc75c.
Report an issue: GitHub.
Appendix: source
Thrown at src/frontend/src/error.rs:95
BoxedError,
),
// TODO(error-handling): there's a limitation that `#[transparent]` can't be used with `#[backtrace]` if no `#[from]`
// So we emulate a transparent error with "{0}" display here.
#[error("{0}")]
BatchError(
#[source]
#[backtrace]
// `BatchError`
BoxedError,
),
#[error("Array error: {0}")]
ArrayError(
#[from]
#[backtrace]
ArrayError,
),
#[cfg(feature = "datafusion")]
#[error("DataFusion error: {0}")]
DataFusionError(
#[from]
#[backtrace]
datafusion_common::DataFusionError,
),
#[error("Stream error: {0}")]
StreamError(
#[backtrace]
#[source]
BoxedError,
),
// TODO(error-handling): there's a limitation that `#[transparent]` can't be used with `#[backtrace]` if no `#[from]`
// So we emulate a transparent error with "{0}" display here.
#[error("{0}")]
RpcError(
#[source]
#[backtrace]
// `tonic::transport::Error`, `TonicStatusWrapper`, or `RpcError`View on GitHub (pinned to 6469eb736d)