{"record":{"id":"1a171ae45643f99e","repo":"prestodb/presto","slug":"not-a-hive-table","errorCode":null,"errorMessage":"Not a Hive table: ","messagePattern":"Not a Hive table: ","errorType":"exception","errorClass":"UnknownTableTypeException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java","lineNumber":703,"sourceCode":"        Optional<Table> table = metastore.getTable(metastoreContext, hiveTableHandle);\n        return getTableMetadata(table, hiveTableHandle.getSchemaTableName(), metastoreContext, session);\n    }\n\n    private ConnectorTableMetadata getTableMetadata(ConnectorSession session, SchemaTableName tableName)\n    {\n        MetastoreContext metastoreContext = getMetastoreContext(session);\n        Optional<Table> table = metastore.getTable(metastoreContext, tableName.getSchemaName(), tableName.getTableName());\n        return getTableMetadata(table, tableName, metastoreContext, session);\n    }\n\n    private ConnectorTableMetadata getTableMetadata(Optional<Table> table, SchemaTableName tableName, MetastoreContext metastoreContext, ConnectorSession session)\n    {\n        if (!table.isPresent() || table.get().getTableType().equals(VIRTUAL_VIEW)) {\n            throw new TableNotFoundException(tableName);\n        }\n\n        if (isIcebergTable(table.get()) || isDeltaLakeTable(table.get())) {\n            throw new UnknownTableTypeException(\"Not a Hive table: \" + tableName);\n        }\n\n        List<TableConstraint<String>> tableConstraints = metastore.getTableConstraints(metastoreContext, tableName.getSchemaName(), tableName.getTableName());\n        List<String> notNullColumns = tableConstraints.stream()\n                .filter(NotNullConstraint.class::isInstance)\n                .map(constraint -> constraint.getColumns().stream()\n                        .findFirst()\n                        .orElseThrow(() -> new PrestoException(HIVE_METASTORE_ERROR, format(\"NOT NULL constraint found with no column in table %s\", tableName.getTableName()))))\n                .collect(toImmutableList());\n        Function<HiveColumnHandle, ColumnMetadata> metadataGetter = columnMetadataGetter(table.get(), typeManager, metastoreContext.getColumnConverter(), notNullColumns);\n        ImmutableList.Builder<ColumnMetadata> columns = ImmutableList.builder();\n        Map<String, ColumnHandle> columnNameToHandleAssignments = new HashMap<>();\n        for (HiveColumnHandle columnHandle : hiveColumnHandles(table.get())) {\n            columns.add(metadataGetter.apply(columnHandle));\n            columnNameToHandleAssignments.put(columnHandle.getName(), columnHandle);\n        }\n\n        // External location property","sourceCodeStart":685,"sourceCodeEnd":721,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveMetadata.java#L685-L721","documentation":"getTableMetadata throws UnknownTableTypeException (message \"Not a Hive table: ...\") when the metastore table is detected as an Iceberg or Delta Lake table, since those must be accessed through their own connectors. A missing table or virtual view throws TableNotFoundException instead.","triggerScenarios":"Querying or resolving metadata for a table that exists in the metastore but was created as an Iceberg or Delta Lake table while connected through the Hive connector.","commonSituations":"Catalog misconfiguration (pointing the Hive connector at Iceberg/Delta tables); after migrating a table's format without updating the catalog; environments where table format is mixed within one metastore database.","solutions":["Register and query the table through the Iceberg or Delta Lake connector/catalog instead","Verify the table's format (input/output format properties) and recreate as a true Hive table if Hive access is required","Check your catalog configuration in etc/catalog/*.properties to route the table to the correct connector"],"exampleFix":"-- before: querying iceberg table via hive catalog\nSELECT * FROM hive.default.iceberg_tbl;\n-- after\nSELECT * FROM iceberg.default.iceberg_tbl;","handlingStrategy":"validation","validationCode":"Table t = metastore.getTable(...);\nif (t == null || VIRTUAL_VIEW.equals(t.getTableType())) {\n    throw new IllegalStateException(\"table missing or is a view\");\n}\nif (isIcebergTable(t) || isDeltaLakeTable(t)) {\n    throw new IllegalStateException(\"Use the iceberg/delta catalog for \" + tableName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    // hive catalog query\n} catch (UnknownTableTypeException e) {\n    // retry against iceberg/delta catalog\n}","preventionTips":["Route Iceberg/Delta tables to their own catalogs in catalog configuration","Check a table's input/output format before querying it via the Hive catalog","Standardize table formats per database/schema to avoid mixed-format surprises"],"tags":["hive","iceberg","delta-lake","table-format","wrong-connector"],"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"}