{"record":{"id":"9b82c7626738eaa3","repo":"prestodb/presto","slug":"hudi-unknown-table-type","errorCode":"HUDI_UNKNOWN_TABLE_TYPE","errorMessage":"Unknown table type ","messagePattern":"Unknown table type ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hudi/src/main/java/com/facebook/presto/hudi/HudiMetadata.java","lineNumber":100,"sourceCode":"    public List<String> listSchemaNames(ConnectorSession session)\n    {\n        return metastore.getAllDatabases(toMetastoreContext(session));\n    }\n\n    @Override\n    public ConnectorTableHandle getTableHandle(ConnectorSession session, SchemaTableName tableName)\n    {\n        Optional<Table> hiveTable = metastore.getTable(toMetastoreContext(session), tableName.getSchemaName(), tableName.getTableName());\n        if (!hiveTable.isPresent()) {\n            return null;\n        }\n\n        Table table = hiveTable.get();\n        String inputFormat = table.getStorage().getStorageFormat().getInputFormat();\n        HudiTableType hudiTableType = HudiTableType.fromInputFormat(inputFormat);\n\n        if (hudiTableType == HudiTableType.UNKNOWN) {\n            throw new PrestoException(HUDI_UNKNOWN_TABLE_TYPE, \"Unknown table type \" + inputFormat);\n        }\n\n        return new HudiTableHandle(\n                table.getDatabaseName(),\n                table.getTableName(),\n                table.getStorage().getLocation(),\n                hudiTableType);\n    }\n\n    @Override\n    public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName)\n    {\n        // TODO: support hive flavour system tables\n        return Optional.empty();\n    }\n\n    @Override\n    public ConnectorTableLayoutResult getTableLayoutForConstraint(","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hudi/src/main/java/com/facebook/presto/hudi/HudiMetadata.java#L82-L118","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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","Check routing rules / catalog assignment so only Hudi tables hit the hudi catalog","Compare the table's input format string with HudiTableType.fromInputFormat; if a new Hudi format is missing, upgrade Presto","Recreate/rewrite the table with standard Hudi input formats if it was written with a nonstandard format"],"exampleFix":"-- before: query routed to hudi catalog but table is plain Hive\nSELECT * FROM hudi.schema.plain_hive_table;\n-- after: query from the hive catalog\nSELECT * FROM hive.schema.plain_hive_table;","handlingStrategy":"validation","validationCode":"// check the table is Hudi before routing/queries\nString inputFormat = table.getStorage().getStorageFormat().getInputFormat();\nboolean isHudi = inputFormat.startsWith(\"org.apache.hudi.hadoop.Hoodie\")\n    || inputFormat.startsWith(\"org.apache.hudi.hadoop.realtime\");\nif (!isHudi) {\n    throw new PrestoException(NOT_SUPPORTED,\n        \"Table \" + table.getTableName() + \" is not a Hudi table (input format: \" + inputFormat + \")\");\n}","typeGuard":"boolean isKnownHudiTableType(String inputFormat) {\n    return HudiTableType.fromInputFormat(inputFormat) != HudiTableType.UNKNOWN;\n}","tryCatchPattern":"try {\n    handle = hudiMetadata.getTableHandle(table);\n} catch (PrestoException e) {\n    if (e.getCode() == HUDI_UNKNOWN_TABLE_TYPE.toErrorCode()) {\n        log.warn(\"%s is not a Hudi table; query it via the hive catalog\", table.getTableName());\n        // fall back to the hive catalog connector\n    } else throw e;\n}","preventionTips":["Route only Hudi tables to the hudi catalog (check input format or table properties)","Query plain Hive/Parquet tables from the hive catalog","Keep Presto upgraded so new Hudi input format class names are recognized","Verify tables were created with standard Hudi CoW/MoR formats"],"tags":["hudi","table-type","input-format","metadata"],"backgroundTag":"unknown-table-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"}