From 011ba5681fc6c052e2d10eb3090fcbb6b47f566b Mon Sep 17 00:00:00 2001 From: Bret McGuire Date: Mon, 10 Jul 2023 19:25:55 -0500 Subject: [PATCH] Add info re: float array extra codec --- manual/core/custom_codecs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/manual/core/custom_codecs/README.md b/manual/core/custom_codecs/README.md index 92a0274577b..b91bf0251d3 100644 --- a/manual/core/custom_codecs/README.md +++ b/manual/core/custom_codecs/README.md @@ -256,6 +256,20 @@ that maps instances of that class to Json strings, using a newly-allocated, defa It is also possible to pass a custom `ObjectMapper` instance using [ExtraTypeCodecs.json(Class, ObjectMapper)] instead. +#### Mapping CQL vectors to Java array + +By default, the driver maps CQL `vector` to the [CqlVector] value type. If you prefer to deal with +arrays, the driver offers the following codecs: + +1. For primitive types: + +| Codec | CQL type | Java type | +|---------------------|-----------------|-----------| +| [ExtraTypeCodecs.floatVectorToArray(dimensions)] | `vector` | `float[]` | + +This release only provides a codec for vectors and arrays containing float values. Support for other primitive +numerical types may be added in future releases. + ### Writing codecs If none of the driver built-in codecs above suits you, it is also possible to roll your own.