risingwavelabs/risingwave · error · GenDataFusionPlanError
Generating plan error
Error message
Generating plan error: {0} What it means
The `Generating` variant of `GenDataFusionPlanError` wraps an underlying `RwError` produced while building the DataFusion `LogicalPlan` (e.g. schema/type conversion failures when mapping RisingWave fields to Arrow/DataFusion types). The message prefixes the wrapped error's display text.
Solutions
- Inspect the wrapped source error (`RwError`) for the root cause and fix accordingly.
- Check for unsupported column/expression types in the query and cast them to supported types.
- Align the DataFusion dependency version with what the translation code expects.
Example fix
-- before SELECT * FROM iceberg_tbl WHERE exotic_udb_col > 1; -- type fails DataFusion translation -- after SELECT * FROM iceberg_tbl WHERE CAST(exotic_col AS DOUBLE) > 1.0;
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-check column types are Arrow-representable before generating the plan
const bad = cols.filter(c => !ARROW_SUPPORTED_TYPES.has(c.type));
if (bad.length) throw new Error("columns unsupported by DataFusion: " + bad.map(c => c.name)); Type guard
function isArrowRepresentable(rwType) { return ARROW_SUPPORTED_TYPES.has(rwType); } Try / catch
match try_gen_datafusion_plan(&plan) {
Err(GenDataFusionPlanError::Generating(src)) => {
log::error!("datafusion plan generation failed: {src}"); // inspect wrapped RwError
}
r => r?,
} Prevention
- Log/inspect the wrapped #[source] RwError — it contains the real cause
- Cast exotic column types to supported types before querying via the DataFusion path
- Keep the DataFusion dependency version compatible with the translation code
When it happens
Trigger: Any failure inside DataFusion plan construction during `try_gen_datafusion_plan`: unsupported RisingWave data types with no Arrow equivalent, invalid expression translation, or DataFusion API errors while registering scans/projections.
Common situations: Iceberg tables with column types not representable in the expected Arrow/DataFusion schema; expression pushdown of functions DataFusion does not implement; version drift between the DataFusion dependency and the translation code.
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
- Missing Iceberg Scan
- Unsupported Plan Node
- adlsgen2.authority_host does not parse as a URL
- adlsgen2.authority_host must not contain a path component
- adlsgen2.authority_host must not contain a query or fragment
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/6ef1e52968bef081.
Report an issue: GitHub.
Appendix: source
Thrown at src/frontend/src/datafusion/execute/mod.rs:66
mod query_planner;
pub(crate) use memory_ctx::create_df_spillable_budget_ctx;
const DF_MANAGED_SPILL_DIR: &str = "df_batch_spill/";
#[derive(Clone)]
pub struct DfBatchQueryPlanResult {
pub(crate) plan: Arc<LogicalPlan>,
pub(crate) schema: RwSchema,
pub(crate) stmt_type: StatementType,
}
#[derive(Debug, Error)]
pub enum GenDataFusionPlanError {
#[error("Missing Iceberg Scan")]
MissingIcebergScan,
#[error("Unsupported Plan Node")]
UnsupportedPlanNode,
#[error("Generating plan error: {0}")]
Generating(#[source] RwError),
}
pub fn try_gen_datafusion_plan(
optimized_logical: &BatchOptimizedLogicalPlanRoot,
) -> Result<Arc<LogicalPlan>, GenDataFusionPlanError> {
use crate::optimizer::DataFusionExecuteCheckerExt;
let check_result = optimized_logical.plan.check_for_datafusion();
if !check_result.have_iceberg_scan {
return Err(GenDataFusionPlanError::MissingIcebergScan);
}
if !check_result.supported {
return Err(GenDataFusionPlanError::UnsupportedPlanNode);
}
let plan = optimized_logical
.gen_datafusion_logical_plan()View on GitHub (pinned to 6469eb736d)