{"record":{"id":"ca92e66aa93c9a86","repo":"apache/iceberg","slug":"ignoring-as-such-values-are-constant-within-a-ca92e6","errorCode":null,"errorMessage":"Ignoring '{}' as such values are constant within a partition","messagePattern":"Ignoring '(.+?)' as such values are constant within a partition","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/actions/SparkHilbertFileRewriteRunner.java","lineNumber":154,"sourceCode":"            ? schema.findField(H_COLUMN) == null\n            : schema.caseInsensitiveFindField(H_COLUMN) == null,\n        \"Cannot HILBERT because the table has a column named '%s', which conflicts with Iceberg's internal Hilbert column name\",\n        H_COLUMN);\n\n    List<String> validHilbertColNames = Lists.newArrayList();\n\n    for (String colName : inputHilbertColNames) {\n      Types.NestedField field =\n          caseSensitive ? schema.findField(colName) : schema.caseInsensitiveFindField(colName);\n      Preconditions.checkArgument(\n          field != null,\n          \"Cannot find column '%s' in table schema (case sensitive = %s): %s\",\n          colName,\n          caseSensitive,\n          schema.asStruct());\n\n      if (identityPartitionFieldIds.contains(field.fieldId())) {\n        LOG.warn(\"Ignoring '{}' as such values are constant within a partition\", colName);\n      } else {\n        validHilbertColNames.add(colName);\n      }\n    }\n\n    Preconditions.checkArgument(\n        !validHilbertColNames.isEmpty(),\n        \"Cannot HILBERT, all columns provided were identity partition columns and cannot be used\");\n\n    return validHilbertColNames;\n  }\n}\n","sourceCodeStart":136,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/actions/SparkHilbertFileRewriteRunner.java#L136-L167","documentation":"SparkHilbertFileRewriteRunner filters z-order/hilbert input columns that are identity-partition columns, because such columns are constant within each partition and hilbert curve ordering on them is meaningless. It logs this warning and excludes the column instead of failing.","triggerScenarios":"Passing a column name via the hilbert rewrite options that is also an identity transform partition field; the column resolves in the schema but its field id is in identityPartitionFieldIds.","commonSituations":"Users reuse the table's partition column in the hilbert ordering option list, often copy-pasted from a previous unpartitioned table configuration.","solutions":["Remove the partition column from the hilbert column option list","Choose high-cardinality non-partition columns for hilbert ordering","If full-table coverage of that column is needed, rewrite without relying on hilbert ordering for it"],"exampleFix":"// before\n.option(\"hilbert_columns\", \"date,id\")   // 'date' is an identity partition column\n// after\n.option(\"hilbert_columns\", \"id\")        // exclude constant-per-partition columns","handlingStrategy":"validation","validationCode":"Set<Integer> identityPartitionIds = table.spec().identitySourceFieldIds();\nList<String> validCols = requestedCols.stream()\n    .filter(c -> !identityPartitionIds.contains(table.schema().findField(c).fieldId()))\n    .collect(Collectors.toList());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-check z-order/hilbert column options against table.spec() identity partition fields","Exclude partition columns from clustering column lists","Prefer high-cardinality non-partitioned columns for ordering"],"tags":["spark","hilbert-curve","rewrite","partitioning"],"backgroundTag":"ignored-config-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}