{"record":{"id":"0a56e6f22b49bdcf","repo":"apache/iceberg","slug":"fallback-to-use-none-distribution-mode-beca-0a56e6","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/dynamic/HashKeyGenerator.java","lineNumber":140,"sourceCode":"      int writeParallelism) {\n    LOG.debug(\n        \"Creating new KeySelector for table '{}' with distribution mode '{}'\", tableName, mode);\n    switch (mode) {\n      case NONE:\n        if (equalityFields.isEmpty()) {\n          return tableKeySelector(tableName, writeParallelism, maxWriteParallelism);\n        } else {\n          LOG.info(\n              \"{}: Distribute rows by equality fields, because there are equality fields set\",\n              tableName);\n          return equalityFieldKeySelector(\n              tableName, schema, equalityFields, writeParallelism, maxWriteParallelism);\n        }\n\n      case HASH:\n        if (equalityFields.isEmpty()) {\n          if (spec.isUnpartitioned()) {\n            LOG.warn(\n                \"{}: Fallback to use 'none' distribution mode, because there are no equality fields set \"\n                    + \"and table is unpartitioned\",\n                tableName);\n            return tableKeySelector(tableName, writeParallelism, maxWriteParallelism);\n          } else {\n            return partitionKeySelector(\n                tableName, schema, spec, writeParallelism, maxWriteParallelism);\n          }\n        } else {\n          if (spec.isUnpartitioned()) {\n            LOG.info(\n                \"{}: Distribute rows by equality fields, because there are equality fields set \"\n                    + \"and table is unpartitioned\",\n                tableName);\n            return equalityFieldKeySelector(\n                tableName, schema, equalityFields, writeParallelism, maxWriteParallelism);\n          } else {\n            for (PartitionField partitionField : spec.fields()) {","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/HashKeyGenerator.java#L122-L158","documentation":"HashKeyGenerator.getKeySelector warns that a hash distribution request is degraded to 'none' mode (per-table fan-out via tableKeySelector) when there are no equality fields and the table is unpartitioned, since there is no key to hash. Rows are therefore not clustered by any key before writing.","triggerScenarios":"Dynamic Iceberg sink processing a table with HASH distribution mode, empty equalityFields, and an unpartitioned spec; the tableName is included in the message to identify which table in the dynamic stream is affected.","commonSituations":"Dynamic multi-table pipelines where some target tables lack partition specs and primary keys while the job is configured with hash distribution; schema changes removing identifier fields from a table.","solutions":["Add a partition spec or identifier fields (primary keys) to the affected table so hash keying is possible.","Change the job/table write.distribution-mode to 'none' for key-less unpartitioned tables.","Verify equalityFields resolution in the dynamic sink config for that table name."],"exampleFix":"// before\n--table-props write.distribution-mode=hash // applies to unpartitioned, key-less table too\n// after\n// per-table: set write.distribution-mode=none for tables without partition spec / primary keys","handlingStrategy":"validation","validationCode":"if (mode == DistributionMode.HASH && equalityFields.isEmpty() && spec.isUnpartitioned()) {\n  LOG.warn(\"{}: hash mode degraded to none\", tableName); // surface before submit\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit dynamic-sink target tables for missing partition specs / primary keys","Set per-table write.distribution-mode appropriately in dynamic pipelines","Alert on the per-table warning to catch schema drift in multi-table streams"],"tags":["flink","distribution-mode","dynamic-sink","configuration"],"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"}