{"record":{"id":"b13f35d41a67de96","repo":"apache/iceberg","slug":"ignoring-as-such-values-are-constant-within-a-b13f35","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":"info","filePath":"spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/actions/SparkZOrderFileRewriteRunner.java","lineNumber":199,"sourceCode":"            ? schema.findField(Z_COLUMN) == null\n            : schema.caseInsensitiveFindField(Z_COLUMN) == null,\n        \"Cannot zorder because the table has a column named '%s', which conflicts with Iceberg's internal Z-order column name\",\n        Z_COLUMN);\n\n    List<String> validZOrderColNames = Lists.newArrayList();\n\n    for (String colName : inputZOrderColNames) {\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        validZOrderColNames.add(colName);\n      }\n    }\n\n    Preconditions.checkArgument(\n        !validZOrderColNames.isEmpty(),\n        \"Cannot ZOrder, all columns provided were identity partition columns and cannot be used\");\n\n    return validZOrderColNames;\n  }\n}\n","sourceCodeStart":181,"sourceCodeEnd":212,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/actions/SparkZOrderFileRewriteRunner.java#L181-L212","documentation":"WARN from SparkZOrderFileRewriteRunner.validZOrderColNames: a column requested for z-ordering is an identity partition column, so its values are constant within each partition and contribute nothing to z-order. The column is dropped from the z-order column list instead of failing the job.","triggerScenarios":"rewrite_data_files with z_order strategy including a column that is an identity partition field (e.g. z-order on (date, id) where date is an identity partition column).","commonSituations":"Auto-generated configs z-ordering all columns including partition keys; users expecting z-order to help on partition columns; partition-evolution leaving old identity partition columns in the option list.","solutions":["Remove identity partition columns from the z-order column option; z-order only helps on non-partition columns.","Keep the warning if the config is generic — behavior is correct, the column is just skipped.","If you intended clustering within partitions, choose non-partition columns with high cardinality."],"exampleFix":"// before\naction.option(\"z-order-cols\", \"date,user_id\").execute(); // date is identity partition col\n// after\naction.option(\"z-order-cols\", \"user_id\").execute();","handlingStrategy":"validation","validationCode":"Set<Integer> partitionCols = table.spec().identitySourceFieldIds(); List<String> zCols = option(\"z-order-cols\") filtered to cols whose fieldId not in partitionCols;","typeGuard":"boolean isIdentityPartitionCol(Schema schema, PartitionSpec spec, String name) { Types.NestedField f = schema.findField(name); return f != null && spec.identitySourceFieldIds().contains(f.fieldId()); }","tryCatchPattern":null,"preventionTips":["Exclude identity partition columns from z-order-cols","After partition evolution, regenerate the z-order column list","Prefer high-cardinality non-partition columns for z-ordering"],"tags":["logging","spark","z-order","partitioning"],"backgroundTag":"ignored-option","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"}