prestodb/presto · error · PrestoException

HUDI_UNKNOWN_TABLE_TYPE

HUDI_UNKNOWN_TABLE_TYPE

Error message

Unknown table type 

What it means

HudiMetadata.getTableHandle resolves a Hive table into a Hudi table handle by inspecting the storage input format. HudiTableType.fromInputFormat recognizes the Hudi copy-on-write and merge-on-read input formats; anything else maps to UNKNOWN and the code throws PrestoException(HUDI_UNKNOWN_TABLE_TYPE). This guards the connector so it only claims tables that are actually Hudi tables.

Source

Thrown at presto-hudi/src/main/java/com/facebook/presto/hudi/HudiMetadata.java:100

    public List<String> listSchemaNames(ConnectorSession session)
    {
        return metastore.getAllDatabases(toMetastoreContext(session));
    }

    @Override
    public ConnectorTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)
    {
        Optional<Table> hiveTable = metastore.getTable(toMetastoreContext(session), tableName.getSchemaName(), tableName.getTableName());
        if (!hiveTable.isPresent()) {
            return null;
        }

        Table table = hiveTable.get();
        String inputFormat = table.getStorage().getStorageFormat().getInputFormat();
        HudiTableType hudiTableType = HudiTableType.fromInputFormat(inputFormat);

        if (hudiTableType == HudiTableType.UNKNOWN) {
            throw new PrestoException(HUDI_UNKNOWN_TABLE_TYPE, "Unknown table type " + inputFormat);
        }

        return new HudiTableHandle(
                table.getDatabaseName(),
                table.getTableName(),
                table.getStorage().getLocation(),
                hudiTableType);
    }

    @Override
    public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName)
    {
        // TODO: support hive flavour system tables
        return Optional.empty();
    }

    @Override
    public ConnectorTableLayoutResult getTableLayoutForConstraint(

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Confirm the table is actually a Hudi table (input format org.apache.hudi.hadoop.HoodieParquetInputFormat or HoodieParquetMergeOnReadInputFormat); query plain Hive tables from the hive catalog instead
  2. Check routing rules / catalog assignment so only Hudi tables hit the hudi catalog
  3. Compare the table's input format string with HudiTableType.fromInputFormat; if a new Hudi format is missing, upgrade Presto
  4. Recreate/rewrite the table with standard Hudi input formats if it was written with a nonstandard format

Example fix

-- before: query routed to hudi catalog but table is plain Hive
SELECT * FROM hudi.schema.plain_hive_table;
-- after: query from the hive catalog
SELECT * FROM hive.schema.plain_hive_table;
Defensive patterns

Strategy: validation

Validate before calling

// check the table is Hudi before routing/queries
String inputFormat = table.getStorage().getStorageFormat().getInputFormat();
boolean isHudi = inputFormat.startsWith("org.apache.hudi.hadoop.Hoodie")
    || inputFormat.startsWith("org.apache.hudi.hadoop.realtime");
if (!isHudi) {
    throw new PrestoException(NOT_SUPPORTED,
        "Table " + table.getTableName() + " is not a Hudi table (input format: " + inputFormat + ")");
}

Type guard

boolean isKnownHudiTableType(String inputFormat) {
    return HudiTableType.fromInputFormat(inputFormat) != HudiTableType.UNKNOWN;
}

Try / catch

try {
    handle = hudiMetadata.getTableHandle(table);
} catch (PrestoException e) {
    if (e.getCode() == HUDI_UNKNOWN_TABLE_TYPE.toErrorCode()) {
        log.warn("%s is not a Hudi table; query it via the hive catalog", table.getTableName());
        // fall back to the hive catalog connector
    } else throw e;
}

Prevention

When it happens

Trigger: Querying a table that matched the connector's schema/table-name resolution but whose StorageFormat input format is not a Hudi CoW/MoR format — e.g. a plain Hive/ORC/Parquet table being routed into the Hudi connector, or a Hudi table written with input formats newer than this Presto version recognizes.

Common situations: Catalog routing misconfiguration sending non-Hudi tables to the hudi catalog; Hudi tables created with custom/legacy input format class names; older Presto that lacks recently introduced Hudi input format classes.

Related errors


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