{"record":{"id":"a858ed2cf9ff3275","repo":"SigNoz/signoz","slug":"unsupported-aggregate-operator","errorCode":null,"errorMessage":"unsupported aggregate operator","messagePattern":"unsupported aggregate operator","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"warning","filePath":"pkg/query-service/app/clickhouseReader/reader.go","lineNumber":3489,"sourceCode":"\t\tv3.AggregateOperatorP10,\n\t\tv3.AggregateOperatorP20,\n\t\tv3.AggregateOperatorP25,\n\t\tv3.AggregateOperatorP50,\n\t\tv3.AggregateOperatorP75,\n\t\tv3.AggregateOperatorP90,\n\t\tv3.AggregateOperatorP95,\n\t\tv3.AggregateOperatorP99,\n\t\tv3.AggregateOperatorAvg,\n\t\tv3.AggregateOperatorSum,\n\t\tv3.AggregateOperatorMin,\n\t\tv3.AggregateOperatorMax:\n\t\twhere = \"tag_key ILIKE $1 AND (tag_data_type='int64' or tag_data_type='float64')\"\n\t\tstringAllowed = false\n\tcase\n\t\tv3.AggregateOperatorNoOp:\n\t\treturn &v3.AggregateAttributeResponse{}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported aggregate operator\")\n\t}\n\n\tquery = fmt.Sprintf(\"SELECT DISTINCT(tag_key), tag_type, tag_data_type from %s.%s WHERE %s and tag_type != 'logfield' limit $2\", r.logsDB, r.logsTagAttributeTableV2, where)\n\trows, err = r.db.Query(ctx, query, fmt.Sprintf(\"%%%s%%\", req.SearchText), req.Limit)\n\tif err != nil {\n\t\tr.logger.Error(\"Error while executing query\", errorsV2.Attr(err))\n\t\treturn nil, fmt.Errorf(\"error while executing query: %s\", err.Error())\n\t}\n\tdefer rows.Close()\n\n\tstatements := []model.ShowCreateTableStatement{}\n\tquery = fmt.Sprintf(\"SHOW CREATE TABLE %s.%s\", r.logsDB, r.logsLocalTableName)\n\terr = r.db.Select(ctx, &statements, query)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error while fetching logs schema: %s\", err.Error())\n\t}\n\n\tvar tagKey string","sourceCodeStart":3471,"sourceCodeEnd":3507,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/clickhouseReader/reader.go#L3471-L3507","documentation":"Returned by the log-attribute-key lookup when the aggregate operator in the request is not one of the supported cases for choosing numeric-vs-string tag filtering (only NoOp short-circuits; others fall through a switch whose default rejects). It is a request-validation error.","triggerScenarios":"Calling GetAttributeKeys (logs) with an unsupported v3.AggregateOperator in filters/aggregate source, e.g. a newly added operator constant not handled by this switch.","commonSituations":"Client built against a newer SigNoz API sending operators this query-service version doesn't know; hand-crafted API requests with invalid operator strings parsed to an unexpected enum value.","solutions":["Check which aggregate operator the request carries and use a supported one (e.g. NoOp for plain key listing)","Align client and query-service versions","Add the operator to the switch or map it to string-allowed behavior if extending SigNoz"],"exampleFix":"// before\ndefault:\n    return nil, fmt.Errorf(\"unsupported aggregate operator\")\n\n// after: default to string-allowed behavior for unknown ops\ndefault:\n    where = \"tag_key ILIKE $1\"\n    stringAllowed = true","handlingStrategy":"validation","validationCode":"var supportedOps = map[v3.AggregateOperator]bool{v3.AggregateOperatorNoOp: true /* ... */}\nif !supportedOps[req.AggregateOperator] {\n    return errors.New(\"unsupported aggregate operator\")\n}","typeGuard":"func isSupportedLogAggOp(op v3.AggregateOperator) bool {\n    switch op { case v3.AggregateOperatorNoOp: return true }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Pin client and server SigNoz versions","Validate operator enums at request construction"],"tags":["signoz","validation","aggregate-operator","logs"],"backgroundTag":"unsupported-enum-value","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}