{"record":{"id":"dd3d4bdfdf397a7c","repo":"apache/beam","slug":"unsupported-partitioner-only-random-and-murmur3-are","errorCode":null,"errorMessage":"Unsupported partitioner. Only Random and Murmur3 are supported","messagePattern":"Unsupported partitioner\\. Only Random and Murmur3 are supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/cassandra/src/main/java/org/apache/beam/sdk/io/cassandra/SplitGenerator.java","lineNumber":48,"sourceCode":"  private final String partitioner;\n  private final BigInteger rangeMin;\n  private final BigInteger rangeMax;\n  private final BigInteger rangeSize;\n\n  SplitGenerator(String partitioner) {\n    rangeMin = getRangeMin(partitioner);\n    rangeMax = getRangeMax(partitioner);\n    rangeSize = getRangeSize(partitioner);\n    this.partitioner = partitioner;\n  }\n\n  static BigInteger getRangeMin(String partitioner) {\n    if (partitioner.endsWith(\"RandomPartitioner\")) {\n      return BigInteger.ZERO;\n    } else if (partitioner.endsWith(\"Murmur3Partitioner\")) {\n      return BigInteger.valueOf(2).pow(63).negate();\n    } else {\n      throw new UnsupportedOperationException(\n          \"Unsupported partitioner. \" + \"Only Random and Murmur3 are supported\");\n    }\n  }\n\n  static BigInteger getRangeMax(String partitioner) {\n    if (partitioner.endsWith(\"RandomPartitioner\")) {\n      return BigInteger.valueOf(2).pow(127).subtract(BigInteger.ONE);\n    } else if (partitioner.endsWith(\"Murmur3Partitioner\")) {\n      return BigInteger.valueOf(2).pow(63).subtract(BigInteger.ONE);\n    } else {\n      throw new UnsupportedOperationException(\n          \"Unsupported partitioner. \" + \"Only Random and Murmur3 are supported\");\n    }\n  }\n\n  static BigInteger getRangeSize(String partitioner) {\n    return getRangeMax(partitioner).subtract(getRangeMin(partitioner)).add(BigInteger.ONE);\n  }","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/cassandra/src/main/java/org/apache/beam/sdk/io/cassandra/SplitGenerator.java#L30-L66","documentation":"SplitGenerator.getRangeMin() maps the Cassandra ring partitioner to the smallest token value of its token space. Only RandomPartitioner (min 0) and Murmur3Partitioner (min -2^63) are supported; any other partitioner causes an UnsupportedOperationException.","triggerScenarios":"Calling Beam CassandraIO against a cluster whose system.peers partitioner string does not end with 'RandomPartitioner' or 'Murmur3Partitioner' (e.g. ByteOrderedPartitioner) — getRangeMin throws during split generation.","commonSituations":"Cassandra clusters configured with ByteOrderedPartitioner or a custom/dummy partitioner (sometimes set mistakenly during cluster setup); connecting to non-Cassandra ring-compatible databases.","solutions":["Check the cluster partitioner (nodetool describecluster or cqlsh: SELECT partitioner FROM system.local).","Reconfigure the Cassandra cluster to Murmur3Partitioner (the default) — note this requires full data reload/rebuild.","If a different partitioner must be used, fork/extend SplitGenerator to supply correct min/max token bounds for it."],"exampleFix":"// cluster.yaml (before)\npartitioner: org.apache.cassandra.dht.ByteOrderedPartitioner\n// after\npartitioner: org.apache.cassandra.dht.Murmur3Partitioner","handlingStrategy":"validation","validationCode":"String partitioner = session.execute(\"SELECT partitioner FROM system.local\").one().getString(\"partitioner\");\nif (!partitioner.endsWith(\"RandomPartitioner\") && !partitioner.endsWith(\"Murmur3Partitioner\")) {\n  throw new IllegalArgumentException(\"Unsupported partitioner: \" + partitioner);\n}","typeGuard":null,"tryCatchPattern":"try { pipeline.run().waitUntilFinish(); } catch (UnsupportedOperationException | RuntimeException e) { /* inspect partitioner */ }","preventionTips":["Use Murmur3Partitioner (default) on all clusters read via CassandraIO.","Check partitioner before configuring the connector.","Avoid ByteOrderedPartitioner (deprecated) for new clusters."],"tags":["java","apache-beam","cassandra","unsupported-partitioner"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}