{"record":{"id":"a3b1ee4dbf69e962","repo":"databendlabs/databend","slug":"not-implemented-a3b1ee","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/service/src/pipelines/builders/builder_aggregate.rs","lineNumber":119,"sourceCode":"                        code,\n                        agg_func.sig.name.clone(),\n                        agg_func.display.clone(),\n                        state_fields\n                            .iter()\n                            .map(|f| DataField::new(&f.name, f.data_type.clone()))\n                            .collect(),\n                        agg_func\n                            .sig\n                            .args\n                            .iter()\n                            .enumerate()\n                            .map(|(i, data_type)| {\n                                DataField::new(&format!(\"arg_{}\", i), data_type.clone())\n                            })\n                            .collect(),\n                        agg_func.sig.return_type.clone(),\n                    ),\n                    Some((UDFType::Server(_), _state_fields)) => unimplemented!(),\n                }\n            })\n            .collect::<Result<_>>()?;\n\n        let params = AggregatorParams::try_create(\n            input_schema,\n            group_data_types,\n            &group_by,\n            &aggs,\n            &agg_args,\n            cluster_aggregator,\n            max_block_rows,\n            max_block_bytes,\n        )?;\n\n        log::debug!(\"aggregate states layout: {:?}\", params.states_layout);\n\n        Ok(params)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/pipelines/builders/builder_aggregate.rs#L101-L137","documentation":"`build_aggregator_params` panics with `unimplemented!()` when the aggregate expression uses a UDF whose type is `UDFType::Server(_)`: server-side aggregate UDFs have no supported state-field handling yet. The planner only knows how to build AggregateFunctionParams for builtin/Client aggregate functions.","triggerScenarios":"A query registers or invokes an aggregate function resolved as `UDFType::Server(_)` (server aggregate UDF) while building the aggregator parameters for a distributed/cluster plan.","commonSituations":"Users deploying server-side UDFs and running them as aggregate functions; clusters where a UDF definition classifies the function as Server instead of Client.","solutions":["Reclassify the UDF as UDFType::Client (or implement it as a builtin aggregate function) so the supported branch is taken","Define the expected state fields for server aggregate UDFs and implement the match arm","Catch the failure early with a user-facing error (return Err instead of panic) explaining that server aggregate UDFs are unsupported"],"exampleFix":"// before\nSome((UDFType::Server(_), _state_fields)) => unimplemented!(),\n// after\nSome((UDFType::Server(name), _)) => Err(ErrorCode::Unimplemented(format!(\n    \"aggregate function '{}' implemented as a server UDF is not supported yet\", name))),","handlingStrategy":"validation","validationCode":"match &agg.func.func_type {\n    UDFType::Server(_) => return Err(ErrorCode::Unimplemented(\"server aggregate UDFs are not supported\")),\n    _ => {}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only register aggregate UDFs as UDFType::Client","Test aggregate queries with every registered UDF in CI","Add an early schema/bind-time check rejecting server aggregate UDFs"],"tags":["rust","aggregation","udf","panic"],"backgroundTag":"method-not-implemented","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}