{"record":{"id":"12dcc60025453a94","repo":"prestodb/presto","slug":"not-supported-12dcc6","errorCode":"NOT_SUPPORTED","errorMessage":"Unsupported type: ${type}","messagePattern":"Unsupported type: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/relational/SqlToRowExpressionTranslator.java","lineNumber":429,"sourceCode":"        {\n            return constant(node.getSlice(), createCharType(node.getValue().length()));\n        }\n\n        @Override\n        protected RowExpression visitBinaryLiteral(BinaryLiteral node, Context context)\n        {\n            return constant(node.getValue(), VARBINARY);\n        }\n\n        @Override\n        protected RowExpression visitEnumLiteral(EnumLiteral node, Context context)\n        {\n            Type type;\n            try {\n                type = functionAndTypeResolver.getType(parseTypeSignature(node.getType()));\n            }\n            catch (IllegalArgumentException e) {\n                throw new PrestoException(NOT_SUPPORTED, \"Unsupported type: \" + node.getType());\n            }\n\n            return constant(node.getValue(), type);\n        }\n\n        @Override\n        protected RowExpression visitGenericLiteral(GenericLiteral node, Context context)\n        {\n            Type type;\n            try {\n                type = functionAndTypeResolver.getType(parseTypeSignature(node.getType()));\n            }\n            catch (IllegalArgumentException e) {\n                throw new PrestoException(NOT_SUPPORTED, \"Unsupported type: \" + node.getType());\n            }\n\n            try {\n                if (TINYINT.equals(type)) {","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/relational/SqlToRowExpressionTranslator.java#L411-L447","documentation":"In SqlToRowExpressionTranslator.visitEnumLiteral, the type name attached to an enum literal cannot be resolved by the functionAndTypeResolver. When getType(parseTypeSignature(...)) throws IllegalArgumentException, the translator converts it into NOT_SUPPORTED because the enum literal references a type the engine does not know.","triggerScenarios":"Translating a SQL enum literal (e.g. `CAST(x AS my_catalog.my_type)` style typed literal or enum literal syntax) whose declared type string is not a registered type in the current type resolver context.","commonSituations":"Typo in the type name; using a connector-specific type without the connector catalog in scope; queries referencing types removed/renamed in a Presto upgrade.","solutions":["Correct the type name in the literal so it matches a registered type.","Ensure the session/catalog providing the custom type is set so the type resolver can find it.","Check release notes: if the type was renamed/removed in a Presto upgrade, migrate the literal to the new type.","If the connector should supply the type, verify the connector plugin is installed and loaded."],"exampleFix":"// before\nSELECT CAST('A' AS MyEnum)  -- unknown type\n// after\nSELECT CAST('A' AS varchar)  -- or use the correctly registered enum type name","handlingStrategy":"try-catch","validationCode":"// Verify the enum literal's type resolves before running\ntry {\n    metadata.getType(typeName);\n} catch (IllegalArgumentException e) {\n    throw new QueryValidationException(\"Unknown type in enum literal: \" + typeName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(query);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.getCode() && e.getMessage().startsWith(\"Unsupported type:\")) {\n        // fix type name or fall back to a supported type\n    } else throw e;\n}","preventionTips":["Validate type names in typed literals against SHOW FUNCTIONS/information_schema before submitting","Set the session catalog that registers custom types","Check upgrade notes for removed/renamed types","Use CAST with standard types where possible"],"tags":["sql","type-system","literal","not-supported"],"backgroundTag":"unsupported-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"}