{"record":{"id":"7f97eb92cb1263cb","repo":"apache/iceberg","slug":"fallback-to-use-none-distribution-mode-because-7f97eb","errorCode":null,"errorMessage":"Fallback to use 'none' distribution mode, because there are no equality fields set and table is unpartitioned","messagePattern":"Fallback to use 'none' distribution mode, because there are no equality fields set and table is unpartitioned","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java","lineNumber":1001,"sourceCode":"        throw new RuntimeException(\"Unrecognized \" + WRITE_DISTRIBUTION_MODE + \": \" + mode);\n    }\n  }\n\n  private DataStream<RowData> distributeDataStreamByNoneDistributionMode(\n      DataStream<RowData> input, Schema iSchema) {\n    if (equalityFieldIds.isEmpty()) {\n      return input;\n    } else {\n      LOG.info(\"Distribute rows by equality fields, because there are equality fields set\");\n      return input.keyBy(new EqualityFieldKeySelector(iSchema, flinkRowType, equalityFieldIds));\n    }\n  }\n\n  private DataStream<RowData> distributeDataStreamByHashDistributionMode(\n      DataStream<RowData> input, Schema iSchema, PartitionSpec partitionSpec) {\n    if (equalityFieldIds.isEmpty()) {\n      if (partitionSpec.isUnpartitioned()) {\n        LOG.warn(\n            \"Fallback to use 'none' distribution mode, because there are no equality fields set \"\n                + \"and table is unpartitioned\");\n        return input;\n      } else {\n        return input.keyBy(new PartitionKeySelector(partitionSpec, iSchema, flinkRowType));\n      }\n    } else {\n      if (partitionSpec.isUnpartitioned()) {\n        LOG.info(\n            \"Distribute rows by equality fields, because there are equality fields set \"\n                + \"and table is unpartitioned\");\n        return input.keyBy(new EqualityFieldKeySelector(iSchema, flinkRowType, equalityFieldIds));\n      } else {\n        for (PartitionField partitionField : partitionSpec.fields()) {\n          Preconditions.checkState(\n              equalityFieldIds.contains(partitionField.sourceId()),\n              \"In 'hash' distribution mode with equality fields set, source column '%s' of partition field '%s' \"\n                  + \"should be included in equality fields: '%s'\",","sourceCodeStart":983,"sourceCodeEnd":1019,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java#L983-L1019","documentation":"In the newer IcebergSink builder, requesting hash distribution mode with no equality fields on an unpartitioned table gives nothing to hash by, so the sink falls back to no shuffle ('none' mode) and logs this warning. Write parallelism will not be clustered by any key.","triggerScenarios":"IcebergSink.builder() with DistributionMode.HASH (or table property write.distribution-mode=hash), equalityFieldIds empty and partitionSpec unpartitioned, evaluated in distributeDataStreamByHashDistributionMode.","commonSituations":"Setting distribution-mode=hash on an unpartitioned key-less table; template configs applied across many tables regardless of partitioning; expecting hash mode to mitigate small-file issues without keys.","solutions":["Set distribution mode to 'none' (or drop the hash setting) for this table.","Add partitions to the table spec so hash keying by partition applies.","Set .equalityFieldColumns(...) on the IcebergSink builder if a logical key exists."],"exampleFix":"// before\nIcebergSink.builder().distributionMode(DistributionMode.HASH)... // unpartitioned, no keys\n// after\nIcebergSink.builder().distributionMode(DistributionMode.NONE)...","handlingStrategy":"validation","validationCode":"if (mode == DistributionMode.HASH && equalityFieldIds.isEmpty() && table.spec().isUnpartitioned()) {\n  mode = DistributionMode.NONE;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate distribution mode against table spec and equality fields before building the sink","Avoid blanket write.distribution-mode=hash across heterogeneous tables","Prefer NONE for unpartitioned key-less tables"],"tags":["flink","distribution-mode","configuration","partitioning"],"backgroundTag":"conflicting-config-options","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"}