Skip to content

Commit

Permalink
Add info re: float array extra codec
Browse files Browse the repository at this point in the history
  • Loading branch information
absurdfarce committed Jul 11, 2023
1 parent 42ca91c commit 011ba56
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions manual/core/custom_codecs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>` | `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.
Expand Down

0 comments on commit 011ba56

Please sign in to comment.