{"record":{"id":"95b644fb6bd6cbb5","repo":"prestodb/presto","slug":"not-supported-95b644","errorCode":"NOT_SUPPORTED","errorMessage":"Unsupported Hive type %s found in partition keys of table %s.%s","messagePattern":"Unsupported Hive type (.+?) found in partition keys of table (.+?)\\.(.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/PartitionLoader.java","lineNumber":60,"sourceCode":"    public List<HivePartitionKey> getPartitionKeys(Table table, Optional<Partition> partition, String partitionName)\n    {\n        if (!partition.isPresent()) {\n            return ImmutableList.of();\n        }\n        ImmutableList.Builder<HivePartitionKey> partitionKeys = ImmutableList.builder();\n        // partition information provided by Hive Metastore could be out of order\n        List<Column> keys = table.getPartitionColumns();\n        List<HiveColumnHandle> partitionColumns = getPartitionKeyColumnHandles(table);\n        List<String> partitionColumnNames = partitionColumns.stream()\n                .map(HiveColumnHandle::getName)\n                .collect(Collectors.toList());\n        List<String> values = extractPartitionValues(partitionName, Optional.of(partitionColumnNames));\n        checkCondition(keys.size() == values.size(), HIVE_INVALID_METADATA, \"Expected %s partition key values, but got %s\", keys.size(), values.size());\n        for (int i = 0; i < keys.size(); i++) {\n            String name = keys.get(i).getName();\n            HiveType hiveType = keys.get(i).getType();\n            if (!hiveType.isSupportedType()) {\n                throw new PrestoException(NOT_SUPPORTED, format(\"Unsupported Hive type %s found in partition keys of table %s.%s\", hiveType, table.getDatabaseName(), table.getTableName()));\n            }\n            String value = values.get(i);\n            checkCondition(value != null, HIVE_INVALID_PARTITION_VALUE, \"partition key value cannot be null for field: %s\", name);\n            partitionKeys.add(new HivePartitionKey(name, HIVE_DEFAULT_DYNAMIC_PARTITION.equals(value) ? Optional.empty() : Optional.of(value)));\n        }\n        return partitionKeys.build();\n    }\n}\n","sourceCodeStart":42,"sourceCodeEnd":69,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/PartitionLoader.java#L42-L69","documentation":"While loading partitions, each partition key's HiveType is checked against the set of types Presto supports. If a partition key uses a type Presto cannot map (e.g. a UNIONTYPE, INTERVAL, or another exotic Hive type), the connector refuses with NOT_SUPPORTED rather than misrepresenting the data.","triggerScenarios":"Querying or listing partitions of a Hive table whose partition keys include a Hive type not in Presto's supported set (e.g. UNIONTYPE, NULL-type, or connector-unsupported types like INTERVAL).","commonSituations":"Tables created by other Hive-compatible engines using exotic partition-key types; legacy tables with typed partition keys never validated by Presto; migrations from Hive distributions that permit more partition-key types than Presto.","solutions":["Recreate the table with partition keys using supported types (STRING is typical for partition keys).","If the underlying values are fine, cast/normalize the partition column type in Hive before querying through Presto.","Exclude that table from Presto or use a view that avoids the unsupported partition key if the engine permits.","Check hive.type/unsupported-type handling session properties only as a stopgap where the connector offers one."],"exampleFix":"-- before\nCREATE TABLE t (v BIGINT) PARTITIONED BY (p UNIONTYPE<int,string>);\n-- after\nCREATE TABLE t (v BIGINT) PARTITIONED BY (p STRING);","handlingStrategy":"validation","validationCode":"// Before querying, inspect partition key types:\nSELECT * FROM system.jdbc.columns WHERE table_name = 'my_table';\n-- or check via Hive metastore: reject tables whose partition keys are UNIONTYPE, INTERVAL, etc.","typeGuard":null,"tryCatchPattern":"try {\n    connector.listPartitionNames(schema, table, bindings);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.toErrorCode().getCode()) {\n        // fall back to direct Hive access or fix the table schema\n    }\n}","preventionTips":["Use only scalar supported types (typically STRING/INT/DATE) for partition keys.","Audit legacy tables for exotic partition-key types before onboarding them to Presto.","Standardize partition key typing in your DDL review process."],"tags":["hive","partition","unsupported-type","schema"],"backgroundTag":"unsupported-hive-type","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}