prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Unsupported type: 

What it means

ExpressionInterpreter.evaluateCast throws NOT_SUPPORTED when a CAST's target type string cannot be resolved by the metadata type registry. This happens when the planner evaluates a cast expression whose type name is unknown to the server (e.g. from a stale plan, a plugin/connector mismatch, or an unsupported type name).

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/sql/planner/ExpressionInterpreter.java:1132

                    result = LikeFunctions.likePattern(pattern.getSlice(), escape);
                }
                else {
                    result = LikeFunctions.likePattern(pattern.getSlice());
                }

                likePatternCache.put(node, result);
            }

            return result;
        }

        @Override
        public Object visitCast(Cast node, Object context)
        {
            Object value = process(node.getExpression(), context);
            Type targetType = metadata.getType(parseTypeSignature(node.getType()));
            if (targetType == null) {
                throw new PrestoException(NOT_SUPPORTED, "Unsupported type: " + node.getType());
            }

            if (value == null) {
                return null;
            }

            Type sourceType = type(node.getExpression());
            if (value instanceof Expression) {
                if (targetType.equals(sourceType)) {
                    return value;
                }

                return new Cast((Expression) value, node.getType(), node.isSafe(), node.isTypeOnly());
            }

            if (node.isTypeOnly()) {
                return value;
            }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the type name in the query/plan for typos or unsupported types.
  2. Ensure all connector plugins providing custom types are installed on the coordinator.
  3. Verify the plan was produced by the same Presto version that is executing it.
Defensive patterns

Strategy: validation

Validate before calling

if (metadata.getType(parseTypeSignature(typeName)) == null) { throw new IllegalArgumentException("Unknown type: " + typeName); }

Type guard

boolean isKnownType(Metadata metadata, String typeName) { return metadata.getType(parseTypeSignature(typeName)) != null; }

Try / catch

try { Object v = interpreter.evaluate(...); } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.toErrorCode().getCode()) { /* fallback path */ } else { throw e; } }

Prevention

When it happens

Trigger: Interpreting a Cast expression whose node.getType() does not resolve via metadata.getType(parseTypeSignature(...)) — i.e. constant-folding a plan containing a cast to an unregistered/typo'd type.

Common situations: Plans serialized by a different Presto version, custom types from a connector plugin not installed on the coordinator, or hand-built SQL with an invalid type name reaching constant evaluation.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/09e1781cc0d1a941. Report an issue: GitHub.