{"record":{"id":"94e0a5ef7e2d3abb","repo":"prestodb/presto","slug":"invalid-function-argument-94e0a5","errorCode":"INVALID_FUNCTION_ARGUMENT","errorMessage":"%s only applies to %s. Input type is: %s","messagePattern":"(.+?) only applies to (.+?)\\. Input type is: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/geospatial/aggregation/ConvexHullAggregation.java","lineNumber":92,"sourceCode":"        }\n    }\n\n    @OutputFunction(GEOMETRY_TYPE_NAME)\n    public static void output(@AggregationState GeometryState state, BlockBuilder out)\n    {\n        if (state.getGeometry() == null) {\n            out.appendNull();\n        }\n        else {\n            GEOMETRY.writeSlice(out, EsriGeometrySerde.serialize(state.getGeometry()));\n        }\n    }\n\n    private static void validateType(String function, OGCGeometry geometry, Set<GeometryType> validTypes)\n    {\n        GeometryType type = GeometryType.getForEsriGeometryType(geometry.geometryType());\n        if (!validTypes.contains(type)) {\n            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format(\"%s only applies to %s. Input type is: %s\", function, OR_JOINER.join(validTypes), type));\n        }\n    }\n}\n","sourceCodeStart":74,"sourceCodeEnd":96,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/geospatial/aggregation/ConvexHullAggregation.java#L74-L96","documentation":"Input-type validation in ConvexHullAggregation.validateType: the geometry passed to the aggregation function has an Esri geometry type outside the set the function accepts, so it refuses to process it. The message names the function, the accepted types, and the offending input type.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/geospatial/aggregation/ConvexHullAggregation.java:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Filter inputs with ST_GeometryType to keep only supported geometry kinds","Convert geometries to a supported type (e.g. apply ST_Envelope or ST_Points as appropriate) before aggregating","Check the function's documentation for exactly which geometry types it accepts"],"exampleFix":null,"handlingStrategy":"type-guard","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"}