Skip to content

Partitioner names other than CDCPartitioner are assumed to be Murmur3 #543

@cvybhu

Description

@cvybhu

PreparedStatement::set_partitioner_name is given a string with parittioner name and sets the partitioner to the right one based on this name.
Every name other than CDCPartitioner is interpreted as Murmur3Partitioner.

This is dangerous, what if someone tries using a thrid partitioner or types CDCpartitoner instead of CDCpartitioner. We will silently ignore the fact that this is an unrecogized partitioner and use Murmur3.

Maybe this function should return error when partitioner name is unknown.

/// Sets the name of the partitioner used for this statement.
pub(crate) fn set_partitioner_name(&mut self, partitioner_name: Option<&str>) {
self.partitioner_name = match partitioner_name {
Some(partitioner_name) if partitioner_name.ends_with("CDCPartitioner") => {
PartitionerName::CDC
}
_ => PartitionerName::Murmur3,
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions