{"record":{"id":"e224584f7cc9a093","repo":"prestodb/presto","slug":"function-implementation-error-e22458","errorCode":"FUNCTION_IMPLEMENTATION_ERROR","errorMessage":"Unexpected group enum type %s","messagePattern":"Unexpected group enum type (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/arrayagg/ArrayAggregationStateFactory.java","lineNumber":56,"sourceCode":"        return new SingleArrayAggregationState(type);\n    }\n\n    @Override\n    public Class<? extends ArrayAggregationState> getSingleStateClass()\n    {\n        return SingleArrayAggregationState.class;\n    }\n\n    @Override\n    public ArrayAggregationState createGroupedState()\n    {\n        switch (mode) {\n            case NEW:\n                return new GroupArrayAggregationState(type);\n            case LEGACY:\n                return new LegacyArrayAggregationGroupState(type);\n            default:\n                throw new PrestoException(FUNCTION_IMPLEMENTATION_ERROR, format(\"Unexpected group enum type %s\", mode));\n        }\n    }\n\n    @Override\n    public Class<? extends ArrayAggregationState> getGroupedStateClass()\n    {\n        switch (mode) {\n            case NEW:\n                return GroupArrayAggregationState.class;\n            case LEGACY:\n                return LegacyArrayAggregationGroupState.class;\n            default:\n                throw new PrestoException(FUNCTION_IMPLEMENTATION_ERROR, format(\"Unexpected group enum type %s\", mode));\n        }\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":73,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/arrayagg/ArrayAggregationStateFactory.java#L38-L73","documentation":"Internal invariant failure (FUNCTION_IMPLEMENTATION_ERROR) in ArrayAggregationStateFactory.createGroupedState: the configured grouped-state mode enum has a value outside the known NEW/LEGACY set, so no grouped state class can be constructed. This reflects a configuration/build inconsistency, not user input.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/arrayagg/ArrayAggregationStateFactory.java:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the array-agg grouped-state configuration/property uses a supported mode value","Use the default NEW mode unless legacy behavior is explicitly required","Report as a bug if a documented enum value triggers this path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}