{"record":{"id":"602e84cc6ab91a3c","repo":"hasura/graphql-engine","slug":"the-aggregate-expression-name-defines-an-aggrega","errorCode":null,"errorMessage":"the aggregate expression {name} defines an aggregation function mapping to an unknown data connector: {data_connector_name}","messagePattern":"the aggregate expression (.+?) defines an aggregation function mapping to an unknown data connector: (.+?)","errorType":"validation","errorClass":"AggregateExpressionError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/stages/aggregates/types.rs","lineNumber":213,"sourceCode":"\n    #[error(\n        \"the aggregate expression {name} has duplicate definitions of the aggregation function '{function_name}'\"\n    )]\n    AggregateOperandFunctionDuplicated {\n        name: Qualified<AggregateExpressionName>,\n        function_name: AggregationFunctionName,\n    },\n\n    #[error(\n        \"the aggregate expression {name} specifies an aggregation function '{function_name}' that uses an unknown type for its return type: {type_name}\"\n    )]\n    AggregateOperandFunctionUnknownReturnType {\n        name: Qualified<AggregateExpressionName>,\n        function_name: AggregationFunctionName,\n        type_name: CustomTypeName,\n    },\n\n    #[error(\n        \"the aggregate expression {name} defines an aggregation function mapping to an unknown data connector: {data_connector_name}\"\n    )]\n    AggregateOperandDataConnectorMissing {\n        name: Qualified<AggregateExpressionName>,\n        data_connector_name: Qualified<DataConnectorName>,\n    },\n\n    #[error(\n        \"the aggregate expression {name} defines an aggregation function mapping to a data connector that does not support aggregates: {data_connector_name}\"\n    )]\n    AggregateOperandDataConnectorNotSupported {\n        name: Qualified<AggregateExpressionName>,\n        data_connector_name: Qualified<DataConnectorName>,\n    },\n\n    #[error(\n        \"the aggregate expression {name} specifies an aggregation function '{function_name}' but there is no mapping defined to an aggregation function in the data connector '{data_connector_name}'\"\n    )]","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/stages/aggregates/types.rs#L195-L231","documentation":"An aggregation function mapping inside an aggregate expression references a data connector by name, but no data connector with that name exists in the resolved metadata. The resolver needs the connector to look up its supported aggregate functions.","triggerScenarios":"A `data_connector_mappings` entry in an aggregate expression whose `data_connector_name` does not match any configured data connector (datasource) in the metadata.","commonSituations":"Renaming a data source (`ddn connector rename` or editing the datasource YAML) without updating aggregate expressions; removing an old connector; environment-specific connector names differing between dev and prod metadata; typo in the connector name.","solutions":["Compare the connector name in the error with the `data_connector_name` in your datasource metadata files","Fix the name in the aggregate expression's mapping to exactly match the configured connector","If the connector was removed, delete the stale mapping from the aggregate expression","Regenerate metadata via `ddn build` rather than editing by hand"],"exampleFix":"# before\ndata_connector_mappings:\n  - data_connector_name: main_pg # no such connector\n# after\ndata_connector_mappings:\n  - data_connector_name: default/postgres","handlingStrategy":"validation","validationCode":"connector_names = {d['name'] for d in datasources}\nfor m in agg_expr.get('data_connector_mappings', []):\n    assert m['data_connector_name'] in connector_names, f\"unknown connector {m['data_connector_name']}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the same connector name everywhere via the ddn CLI instead of manual edits","After renaming/removing a connector, grep all aggregate expressions for stale mappings"],"tags":["opendd","metadata","aggregates","data-connector","unknown-connector"],"backgroundTag":"data-connector-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}