All pages
Powered by GitBook
1 of 1

Loading...

VEC_ToText

Convert vector to text. This function takes a binary VECTOR data type and returns its JSON array string representation.

Syntax

VEC_ToText(v)

Description

VEC_ToText converts a binary vector into a json array of numbers (floats). Returns NULL and throws a warning if given an invalid vector.

Example

Invalid vector:

See Also

This page is licensed: CC BY-SA / Gnu FDL

SELECT VEC_ToText(x'e360d63ebe554f3fcdbc523f4522193f5236083d');
+---------------------------------------------------------+
| VEC_ToText(x'e360d63ebe554f3fcdbc523f4522193f5236083d') |
+---------------------------------------------------------+
| [0.418708,0.809902,0.823193,0.598179,0.033255]          |
+---------------------------------------------------------+
Error 4201
Error 4201: Invalid binary vector format
SELECT VEC_ToText(x'aabbcc');
+-----------------------+
| VEC_ToText(x'aabbcc') |
+-----------------------+
| NULL                  |
+-----------------------+
1 row in set, 1 warning (0.000 sec)

Warning (Code 4201): Invalid binary vector format. Must use IEEE standard float 
  representation in little-endian format. Use VEC_FromText() to generate it.

Vectors are available from .

Cover

WEBINAR

The Next Generation of MariaDB: Powered by Vector Search

Watch Now
MariaDB 11.7