{"record":{"id":"e2b805c81d1ce8b1","repo":"databendlabs/databend","slug":"not-implemented-aggregatemeta-does-not-support-ex","errorCode":null,"errorMessage":"not implemented: AggregateMeta does not support exchanging between multiple nodes","messagePattern":"not implemented: AggregateMeta does not support exchanging between multiple nodes","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/service/src/pipelines/processors/transforms/aggregator/aggregate_meta.rs","lineNumber":327,"sourceCode":"        match self {\n            AggregateMeta::Partitioned { .. } => {\n                f.debug_struct(\"AggregateMeta::Partitioned\").finish()\n            }\n            AggregateMeta::Serialized { .. } => {\n                f.debug_struct(\"AggregateMeta::Serialized\").finish()\n            }\n            AggregateMeta::Spilled(_) => f.debug_struct(\"Aggregate::Spilled\").finish(),\n            AggregateMeta::BucketSpilled(_) => f.debug_struct(\"Aggregate::BucketSpilled\").finish(),\n            AggregateMeta::AggregatePayload(_) => {\n                f.debug_struct(\"AggregateMeta:AggregatePayload\").finish()\n            }\n        }\n    }\n}\n\nimpl BlockMetaInfo for AggregateMeta {\n    fn typetag_deserialize(&self) {\n        unimplemented!(\"AggregateMeta does not support exchanging between multiple nodes\")\n    }\n\n    fn typetag_name(&self) -> &'static str {\n        unimplemented!(\"AggregateMeta does not support exchanging between multiple nodes\")\n    }\n\n    fn output_stats(&self) -> Option<BlockProfileStatistics> {\n        match self {\n            AggregateMeta::Serialized(payload) => Some(BlockProfileStatistics {\n                rows: payload.data_block.num_rows(),\n                bytes: payload.data_block.memory_size(),\n            }),\n            AggregateMeta::AggregatePayload(payload) => Some(BlockProfileStatistics {\n                rows: payload.payload.len(),\n                bytes: payload.payload.memory_size(),\n            }),\n            AggregateMeta::Partitioned { data, .. } => data.output_stats(),\n            AggregateMeta::BucketSpilled(payload) => Some(BlockProfileStatistics {","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/service/src/pipelines/processors/transforms/aggregator/aggregate_meta.rs#L309-L345","documentation":"`AggregateMeta::typetag_deserialize` is hard-coded to `unimplemented!()` because AggregateMeta block metadata cannot cross node boundaries — it is only valid within a single node's pipeline. Attempting to deserialize (exchange) this metadata panics. This is a designed limitation marking distributed exchange of partial aggregate state as unsupported.","triggerScenarios":"Serializing/deserializing a block carrying AggregateMeta for a cluster data exchange (e.g. exchange/shuffle between nodes in a distributed aggregation plan).","commonSituations":"Distributed query setups where aggregate partial state is routed through flight/exchange channels; testing multi-node aggregation with this metadata attached.","solutions":["Keep aggregation single-node (avoid distributed exchange of aggregate partial state) until support exists","Implement typetag_deserialize/typetag_name for AggregateMeta so it can be serialized across nodes","Use a metadata type designed for exchange (or strip AggregateMeta before serializing blocks for exchange)","Wrap deserialization paths to convert this panic into a clear query error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if matches!(meta.downcast_ref::<AggregateMeta>(), Some(_)) {\n    // route to single-node path instead of exchange\n}","typeGuard":"fn is_aggregate_meta(m: &dyn BlockMetaInfo) -> bool { m.typetag_name_matches(\"AggregateMeta\") }","tryCatchPattern":"match std::panic::catch_unwind(|| serde_exchange::deserialize(block)) {\n    Ok(v) => v,\n    Err(_) => return Err(ErrorCode::Unimplemented(\"AggregateMeta cannot be exchanged between nodes\")),\n}","preventionTips":["Keep partial aggregate state within a single node","Do not attach AggregateMeta to blocks destined for cross-node exchange","Add cluster-mode integration tests for distributed aggregation"],"tags":["rust","distributed","aggregation","panic"],"backgroundTag":"unsupported-operation","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"}