type_codec: add vector type encoding
This change has been introduced to enable CQL drivers to recognize vector type in query results. The encoding has been imported from Apache Cassandra implementation to match Cassandra's and latest drivers' behaviour. Co-authored-by: Dawid Pawlik <501149991dp@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "types/list.hh"
|
||||
#include "types/set.hh"
|
||||
#include "types/map.hh"
|
||||
#include "types/vector.hh"
|
||||
#include "dht/token-sharding.hh"
|
||||
#include "service/migration_manager.hh"
|
||||
#include "service/storage_service.hh"
|
||||
@@ -1952,6 +1953,11 @@ public:
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (type->is_vector()) {
|
||||
r.write_short(uint16_t(type_id::CUSTOM));
|
||||
r.write_string(type->name());
|
||||
return;
|
||||
}
|
||||
if (type->is_collection()) {
|
||||
auto&& ctype = static_cast<const collection_type_impl*>(type.get());
|
||||
if (ctype->get_kind() == abstract_type::kind::map) {
|
||||
|
||||
Reference in New Issue
Block a user