diff --git a/sstables/key.hh b/sstables/key.hh index 032a75d329..856dfcdf35 100644 --- a/sstables/key.hh +++ b/sstables/key.hh @@ -16,12 +16,15 @@ class key_view { bytes_view _bytes; public: key_view(bytes_view b) : _bytes(b) {} + key_view() : _bytes() {} std::vector explode(const schema& s) const; bool operator==(const key_view& k) const { return k._bytes == _bytes; } bool operator!=(const key_view& k) const { return !(k == *this); } + bool empty() { return _bytes.empty(); } + explicit operator bytes_view() const { return _bytes; } diff --git a/sstables/partition.cc b/sstables/partition.cc index 6048c06ed9..ab9f534eeb 100644 --- a/sstables/partition.cc +++ b/sstables/partition.cc @@ -224,7 +224,7 @@ public: mp_row_consumer(const key& key, const schema_ptr _schema) : _schema(_schema) - , _key(key) + , _key(key_view(key)) , mut(partition_key::from_exploded(*_schema, key.explode(*_schema)), _schema) { }