{"record":{"id":"58cba3a25cbd94de","repo":"apache/iceberg","slug":"ignoring-as-such-values-are-constant-within-a-58cba3","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/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.1/spark/src/main/java/org/apache/iceberg/spark/actions/SparkZOrderFileRewriteRunner.java#L181-L212","documentation":"SparkZOrderFileRewriteRunner excludes z-order input columns that are identity-partition columns, since their values are constant within a partition and z-curve ordering adds no benefit. It logs this warning and drops the column from the valid set instead of failing.","triggerScenarios":"Passing a column in the z-order rewrite option that resolves in the schema but whose field id is in identityPartitionFieldIds.","commonSituations":"Users include the table's identity partition column in z-order column options, e.g. copying an option list from a table whose partitioning later changed.","solutions":["Remove the identity partition column from the z-order column list","Select non-partition columns with high cardinality for z-ordering","Review table partitioning to understand why the column is constant per partition"],"exampleFix":"// before\n.option(\"z_order_columns\", \"date,user_id\")  // 'date' is identity partitioned\n// after\n.option(\"z_order_columns\", \"user_id\")","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":["Check identity partition fields before choosing z-order columns","Drop partition columns from the option list","Prefer high-cardinality non-partitioned columns"],"tags":["spark","z-order","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"}