mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
cql3: Avoid using partition_key::from_bytes()
serialize() and from_bytes() is a low level interface, which in this case can be replaced with a partition_key static factory method resulting in cleaner code.
This commit is contained in:
@@ -62,9 +62,8 @@ public:
|
||||
}
|
||||
|
||||
bytes_opt execute(serialization_format sf, const std::vector<bytes_opt>& parameters) override {
|
||||
auto buf = _schema->partition_key_type()->serialize_optionals(parameters);
|
||||
auto view = partition_key_view::from_bytes(std::move(buf));
|
||||
auto tok = dht::global_partitioner().get_token(*_schema, view);
|
||||
auto key = partition_key::from_optional_exploded(*_schema, parameters);
|
||||
auto tok = dht::global_partitioner().get_token(*_schema, key);
|
||||
warn(unimplemented::cause::VALIDATION);
|
||||
return dht::global_partitioner().token_to_bytes(tok);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user