{"record":{"id":"9840efd457e39140","repo":"quarkusio/quarkus","slug":"aggregation-aggregate-not-supported","errorCode":null,"errorMessage":"Aggregation + aggregate + not supported","messagePattern":"Aggregation \\+ aggregate \\+ not supported","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/sortedset/ZAggregateArgs.java","lineNumber":104,"sourceCode":"            args.add(\"WEIGHTS\");\n            for (double w : weights) {\n                args.add(Double.toString(w));\n            }\n        }\n        if (aggregate != null) {\n            args.add(\"AGGREGATE\");\n            switch (aggregate) {\n                case SUM:\n                    args.add(\"SUM\");\n                    break;\n                case MIN:\n                    args.add(\"MIN\");\n                    break;\n                case MAX:\n                    args.add(\"MAX\");\n                    break;\n                default:\n                    throw new IllegalArgumentException(\"Aggregation \" + aggregate + \" not supported\");\n            }\n        }\n        return args;\n    }\n}\n","sourceCodeStart":86,"sourceCodeEnd":110,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/sortedset/ZAggregateArgs.java#L86-L110","documentation":"In ZAggregateArgs.toArgs(), the AGGREGATE clause serializes a chosen aggregation function (SUM, MIN, MAX). The default branch is reached when an unsupported enum/aggregate value is present, so the library throws instead of emitting an invalid command. This guards against enum values added upstream that this args class does not yet map.","triggerScenarios":"Setting an aggregate value on ZAggregateArgs whose switch mapping only handles SUM/MIN/MAX (or the field holds an unexpected value), then calling toArgs().","commonSituations":"Custom or newly introduced aggregation enum constant not yet handled; constructing the args object reflectively or from deserialized data.","solutions":["Use only supported aggregation values: SUM, MIN, MAX","Check the ZAggregateArgs/aggregate enum API for the exact supported constants","Upgrade the quarkus-redis-client version if a newer Redis aggregation option is needed"],"exampleFix":"// before\nargs.aggregate(Aggregate.UNKNOWN); // falls to default branch\n// after\nargs.aggregate(Aggregate.MIN);","handlingStrategy":"validation","validationCode":"if (aggregate != SUM && aggregate != MIN && aggregate != MAX) throw new IllegalArgumentException(\"Unsupported aggregation: \" + aggregate);","typeGuard":"boolean isSupportedAggregate(Aggregate a) { return a == Aggregate.SUM || a == Aggregate.MIN || a == Aggregate.MAX; }","tryCatchPattern":"try {\n    sortedSet.zunion(args);\n} catch (IllegalArgumentException e) {\n    // fall back to SUM or skip the AGGREGATE clause\n}","preventionTips":["Only use enum constants listed in the ZAggregateArgs docs","Pin/upgrade the client version before using new Redis aggregation options","Avoid deserializing aggregate values without validating against supported constants"],"tags":["redis","sorted-set","unsupported-value","zaggregate"],"backgroundTag":"invalid-enum-value","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}