{"record":{"id":"7fcae0cf360b1806","repo":"prestodb/presto","slug":"not-an-iceberg-table-getschematablename","errorCode":null,"errorMessage":"Not an Iceberg table: ${getSchemaTableName()}","messagePattern":"Not an Iceberg table: (.+?)","errorType":"exception","errorClass":"UnknownTableTypeException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/HiveTableOperations.java","lineNumber":216,"sourceCode":"    {\n        if (shouldRefresh) {\n            return refresh();\n        }\n        return currentMetadata;\n    }\n\n    @Override\n    public TableMetadata refresh()\n    {\n        if (location.isPresent()) {\n            refreshFromMetadataLocation(null);\n            return currentMetadata;\n        }\n\n        Table table = getTable();\n\n        if (!isIcebergTable(table)) {\n            throw new UnknownTableTypeException(\"Not an Iceberg table: \" + getSchemaTableName());\n        }\n\n        if (isPrestoView(table)) {\n            throw new TableNotFoundException(new SchemaTableName(database, tableName));\n        }\n\n        String metadataLocation = table.getParameters().get(METADATA_LOCATION);\n        if (metadataLocation == null) {\n            throw new PrestoException(ICEBERG_INVALID_METADATA, format(\"Table is missing [%s] property: %s\", METADATA_LOCATION, getSchemaTableName()));\n        }\n\n        refreshFromMetadataLocation(metadataLocation);\n\n        return currentMetadata;\n    }\n\n    @Override\n    public void commit(@Nullable TableMetadata base, TableMetadata metadata)","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/HiveTableOperations.java#L198-L234","documentation":"HiveTableOperations.refresh loads the Hive-metastore-backed table and requires it to be an Iceberg table (detected via table properties). If the underlying Hive table exists but is not an Iceberg table, refresh throws UnknownTableTypeException with 'Not an Iceberg table: <schema.table>'. Called by current() and metadata(), so any Iceberg operation on this table fails.","triggerScenarios":"Any Iceberg read/commit path touching a Hive table that lacks the Iceberg table_type property — e.g. pointing the Iceberg connector at a plain Hive table, wrong catalog mapping, or the table was converted away from Iceberg after caching.","commonSituations":"Catalog misconfiguration (table registered in both hive and iceberg catalogs), user querying a legacy Hive table through the Iceberg connector, a migration that reverted the table_type property, schema/table name collision across catalogs.","solutions":["Query the table through the correct connector/catalog (use the hive catalog for plain Hive tables).","If it should be Iceberg, migrate it (e.g. Hive-to-Iceberg migration procedure) so table_type=ICEBERG is set.","Check catalog config (iceberg.catalog.type / hive.metastore mapping) so names resolve to the intended catalog.","Confirm the metastore's table parameters still contain the Iceberg markers; re-run migration if a job stripped them."],"exampleFix":"-- before: SELECT * FROM iceberg.default.my_hive_table; -- Not an Iceberg table\n-- after: use correct catalog, or migrate\nSELECT * FROM hive.default.my_hive_table;\n-- or in Spark: CALL catalog.system.migrate('default.my_hive_table');","handlingStrategy":"validation","validationCode":"Table t = metastore.getTable(db, name);\nif (t == null || !\"ICEBERG\".equalsIgnoreCase(t.getParameters().get(\"table_type\"))) {\n  throw new IllegalStateException(\"Not an Iceberg table: \" + db + \".\" + name + \" — use the correct catalog\");\n}","typeGuard":"boolean isIceberg(Table t) { return t != null && t.getParameters() != null && \"ICEBERG\".equalsIgnoreCase(t.getParameters().get(\"table_type\")); }","tryCatchPattern":"try { icebergOps.refresh(); } catch (UnknownTableTypeException e) { /* fall back to hive connector or migrate table */ }","preventionTips":["Use the hive catalog for non-Iceberg tables; keep catalog naming unambiguous","Verify table_type property after any migration in either direction","Avoid duplicate table names across catalogs pointing at the same storage","Document which catalog owns each table namespace"],"tags":["iceberg","hive","table-type","catalog"],"backgroundTag":"not-an-iceberg-table","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"}