{"record":{"id":"080b6fd65ba56442","repo":"prestodb/presto","slug":"not-supported-080b6f","errorCode":"NOT_SUPPORTED","errorMessage":"Unsupported type parameters (%s) for %s","messagePattern":"Unsupported type parameters \\((.+?)\\) for (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ParametricScalar.java","lineNumber":122,"sourceCode":"                checkCondition(selectedImplementation == null, AMBIGUOUS_FUNCTION_IMPLEMENTATION, \"Ambiguous implementation for %s with bindings %s\", getSignature(), boundVariables.getTypeVariables());\n                selectedImplementation = scalarFunctionImplementation.get();\n            }\n        }\n        if (selectedImplementation != null) {\n            return selectedImplementation;\n        }\n        for (ParametricScalarImplementation implementation : implementations.getGenericImplementations()) {\n            Optional<BuiltInScalarFunctionImplementation> scalarFunctionImplementation = implementation.specialize(boundSignature, boundVariables, functionAndTypeManager);\n            if (scalarFunctionImplementation.isPresent()) {\n                checkCondition(selectedImplementation == null, AMBIGUOUS_FUNCTION_IMPLEMENTATION, \"Ambiguous implementation for %s with bindings %s\", getSignature(), boundVariables.getTypeVariables());\n                selectedImplementation = scalarFunctionImplementation.get();\n            }\n        }\n        if (selectedImplementation != null) {\n            return selectedImplementation;\n        }\n\n        throw new PrestoException(NOT_SUPPORTED, format(\"Unsupported type parameters (%s) for %s\", boundVariables, getSignature()));\n    }\n}\n","sourceCodeStart":104,"sourceCodeEnd":125,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/scalar/ParametricScalar.java#L104-L125","documentation":"ParametricScalar.specialize binds declared type variables to concrete types and picks an implementation among registered signatures. When no implementation matches the given type parameters (boundVariables), the engine throws NOT_SUPPORTED with the attempted binding and the function signature.","triggerScenarios":"Invoking a parametric scalar function with type arguments for which no registered specialization exists — e.g. map(array(varchar), row(...)) passed to a function only declared for primitive value types, or a nested/complex type the function's @TypeParameter constraints exclude.","commonSituations":"Calling scalar functions on complex types they were never declared for (raw rows, arrays of arrays when only flat types are supported), or after a type change in the schema (e.g. column became varchar vs integer) that no longer matches a specialization.","solutions":["Cast arguments to supported types explicitly (CAST the complex type to a supported one, e.g. cast(row(...) AS row(a integer, b varchar))).","Check the function's declared signature/type parameters and pass matching types.","Break nested types apart (explode/unnest) so scalar functions operate on supported element types.","Upgrade Presto if a newer version added the missing specialization."],"exampleFix":"// before\nSELECT my_scalar_fn(map_value); -- map_value is map(varchar, row(...))\n// after\nSELECT my_scalar_fn(CAST(map_value AS MAP(VARCHAR, VARCHAR)));","handlingStrategy":"type-guard","validationCode":"-- verify argument types match a supported specialization before calling\ncast(complex_value AS MAP(VARCHAR, VARCHAR))","typeGuard":null,"tryCatchPattern":"BEGIN try(CAST(x AS target_type)) ... END; -- or catch NOT_SUPPORTED and cast/fallback","preventionTips":[],"tags":["presto","type-system","not-supported","specialization"],"backgroundTag":"unsupported-parameter-type","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"}