{"record":{"id":"855c1102bf49ba8a","repo":"prestodb/presto","slug":"not-supported-855c11","errorCode":"NOT_SUPPORTED","errorMessage":"Invalid partition type ","messagePattern":"Invalid partition type ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hudi/src/main/java/com/facebook/presto/hudi/HudiPageSource.java","lineNumber":252,"sourceCode":"                DecimalType decimalType = (DecimalType) type;\n                BigDecimal decimal = new BigDecimal(valueString);\n                decimal = decimal.setScale(decimalType.getScale(), BigDecimal.ROUND_UNNECESSARY);\n                if (decimal.precision() > decimalType.getPrecision()) {\n                    throw new IllegalArgumentException();\n                }\n                BigInteger unscaledValue = decimal.unscaledValue();\n                return isShortDecimal(type) ? unscaledValue.longValue() : Decimals.encodeUnscaledValue(unscaledValue);\n            }\n        }\n        catch (IllegalArgumentException e) {\n            throw new PrestoException(HUDI_INVALID_PARTITION_VALUE, format(\n                    \"Invalid partition value '%s' for %s partition key: %s\",\n                    valueString,\n                    type.getDisplayName(),\n                    name));\n        }\n        // Hudi tables don't partition by non-primitive-type columns.\n        throw new PrestoException(NOT_SUPPORTED, \"Invalid partition type \" + type);\n    }\n}\n","sourceCodeStart":234,"sourceCodeEnd":255,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hudi/src/main/java/com/facebook/presto/hudi/HudiPageSource.java#L234-L255","documentation":"deserializePartitionValue only supports primitive partition column types; if the declared type falls through all supported branches (non-primitive, e.g. map/array/struct or a null-typed column), the connector throws NOT_SUPPORTED with 'Invalid partition type'. Hudi tables are not expected to be partitioned by non-primitive columns.","triggerScenarios":"Querying a Hudi table whose partition column handle has a non-primitive (complex or unrecognized) Presto type, reached while computing a prefilled constant value for a partition column in the page source.","commonSituations":"Tables partitioned on complex columns, metadata/type-mapping mismatches where the partition column resolved to a complex type, or connector bugs in type mapping that let an unsupported partition type through planning.","solutions":["Recreate/repartition the table using only primitive partition columns (string, int, bigint, date, etc.)","Verify the column's type in the metastore; correct it if the metastore type is wrong","Upgrade the connector if planning should have rejected this table earlier — it indicates a metadata/type-mapping gap","Exclude the complex partition column from queries or materialize it as a primitive column"],"exampleFix":"-- before\nPARTITIONED BY (tags array<string>)\n-- after\nPARTITIONED BY (primary_tag string)","handlingStrategy":"validation","validationCode":"// Ensure every partition column is a supported primitive before creating/altering the table\nList<String> PRIMITIVES = List.of(\"varchar\",\"integer\",\"bigint\",\"smallint\",\"tinyint\",\"boolean\",\"date\",\"timestamp\",\"decimal\",\"real\",\"double\");\npartitionColumns.forEach(c -> {\n    if (!PRIMITIVES.contains(c.getType().toLowerCase())) {\n        throw new IllegalStateException(\"Partition column \" + c.getName() +\n            \" must be primitive, got \" + c.getType());\n    }\n});","typeGuard":null,"tryCatchPattern":"try {\n    return pageSource.getNextPage();\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.getCode()\n            && String.valueOf(e.getMessage()).startsWith(\"Invalid partition type\")) {\n        throw new IllegalStateException(\"Repartition table on primitive keys\", e);\n    }\n    throw e;\n}","preventionTips":["Never partition Hudi tables on map/array/struct columns","Enforce partition-key DDL linting in your table-creation tooling","If a complex key is needed, add a derived primitive column for partitioning"],"tags":["presto","hudi","not-supported","partitioning","type-system"],"backgroundTag":"unsupported-partition-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"}