prestodb/presto · error · PrestoException

INVALID_TABLE_PROPERTY

INVALID_TABLE_PROPERTY

Error message

Failed to convert object of type %s to expression: %s

What it means

When building SHOW CREATE output, table/schema properties must be convertible to SQL expressions. Visitor.toExpression supports only primitive types and lists; any other property value type throws this PrestoException with INVALID_TABLE_PROPERTY.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/sql/rewrite/ShowQueriesRewrite.java:474

                return new BooleanLiteral(value.toString());
            }

            if (value instanceof Long || value instanceof Integer) {
                return new LongLiteral(value.toString());
            }

            if (value instanceof Double) {
                return new DoubleLiteral(value.toString());
            }

            if (value instanceof List) {
                List<?> list = (List<?>) value;
                return new ArrayConstructor(list.stream()
                        .map(Visitor::toExpression)
                        .collect(toList()));
            }

            throw new PrestoException(INVALID_TABLE_PROPERTY, format("Failed to convert object of type %s to expression: %s", value.getClass().getName(), value));
        }

        @Override
        protected Node visitShowCreate(ShowCreate node, Void context)
        {
            if (node.getType() == SCHEMA) {
                CatalogSchemaName catalogSchemaName = createCatalogSchemaName(session, node, Optional.of(node.getName()), metadata);
                if (!metadataResolver.schemaExists(catalogSchemaName)) {
                    throw new SemanticException(MISSING_SCHEMA, node, "Schema '%s' does not exist", catalogSchemaName);
                }

                Map<String, Object> properties = metadata.getSchemaProperties(session, catalogSchemaName);
                Map<String, PropertyMetadata<?>> allSchemaProperties = metadata.getSchemaPropertyManager().getAllProperties().get(getConnectorIdOrThrow(session, metadata, catalogSchemaName.getCatalogName()));
                List<Property> propertyNodes = buildProperties("schema " + catalogSchemaName, INVALID_SCHEMA_PROPERTY, properties, allSchemaProperties);
                CreateSchema createSchema = new CreateSchema(
                        node.getName(),
                        false,
                        propertyNodes);

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Identify the connector producing the offending property via the %s type name in the message and update/fix the connector's property handling
  2. Upgrade or patch the connector so property values conform to supported types (primitives or lists of primitives)
  3. Drop/re-set the offending table or schema property so its stored value is convertible
  4. If you control the plugin, convert unsupported values (e.g. maps) to supported serializations before returning them

Example fix

// before (connector property)
properties.put("dimensions", ImmutableMap.of("w", 10, "h", 20));
// after
properties.put("dimensions", ImmutableList.of(10, 20));
Defensive patterns

Strategy: try-catch

Try / catch

try {
    execute("SHOW CREATE TABLE " + fqn);
} catch (PrestoException e) {
    if (e.getErrorCode().getName().equals("INVALID_TABLE_PROPERTY")) {
        log.error("Connector returned an unconvertible property value; inspect connector: {}", e.getMessage());
    } else { throw e; }
}

Prevention

When it happens

Trigger: SHOW CREATE TABLE/SCHEMA on an object whose custom connector metadata properties contain a value type that is not a String, Boolean, number, or List (e.g. a Map or custom object returned by a connector's getTableProperties).

Common situations: Custom or third-party connectors storing non-primitive property values; property values that changed shape across connector/plugin versions; corrupted metadata from storage backends.

Related errors


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