lvector_normalize
Signature:
CREATE FUNCTION lvector_normalize(lvec lvector_embedding) RETURNS lvector_embedding; Purpose: Normalizes a lvector_embedding value.
SELECT lvector_out(lvector_normalize(lvector_in('[1,2,3,4]'))) AS normalized FROM systables
WHERE tabid = 1;-
lvector_compare
Signature:
CREATE FUNCTION lvector_compare(v1 lvector_embedding, v2 lvector_embedding);
Purpose: Compares two lvector_embedding values. It is also related to type comparison support. Example:SELECT lvector_compare(lvector_in('[1,2,3,4]'), lvector_in('[1,2,3,4]')) AS cmp
FROM systables WHERE tabid = 1;
Note: There is also a generic compare(lvector_embedding,lvector_embedding) support function in objects.sql for
the opaque type. If direct catalog queries trigger compare resolution errors, use objects.sql as the source of truth for signatures.
lvector type I/O routines -
lvector_in
Chapter 6. Resources Included With Your HCL Informix VectorBlade
Signature:
CREATE FUNCTION lvector_in(input LVARCHAR) RETURNS lvector_embedding;
Purpose: Converts text representation into the internal lvector_embedding type. Example:SELECT lvector_dimensions(lvector_in('[1,2,3,4]')) AS dims
FROM systables WHERE tabid = 1;
Note: This is user-testable and useful in demos. Tested output: dims = 4.
lvector_outSignature:
CREATE FUNCTION lvector_out(lvec lvector_embedding) RETURNS LVARCHAR; Purpose: Converts the internal lvector_embedding value back to text. Example:
SELECT lvector_out(lvector_in('[1,2,3,4]')) AS roundtrip FROM systables
WHERE tabid = 1;
Note: Tested output: roundtrip = [1,2,3,4].
lvector_recvSignature:
CREATE FUNCTION lvector_recv(data SENDRECV) RETURNS lvector_embedding; Purpose: Binary receive function for the lvector type.
Note: Type-system support routine. Usually not called directly by application SQL.
lvector_sendSignature:
CREATE FUNCTION lvector_send(lvec lvector_embedding) RETURNS SENDRECV; Purpose: Binary send function for the lvector type.
Note: Type-system support routine. Usually not called directly by application SQL.
Table lifecycle routines -
lvector_create_table
Signature:
CREATE PROCEDURE lvector_create_table(table_name LVARCHAR, dimensions INTEGER); Purpose: Creates or initializes a corresponding LanceDB/lvector table.
Example:
EXECUTE PROCEDURE lvector_create_table('docs_demo', 16);
Note: Informix source data and the LanceDB backing table must stay synchronized through explicit sync calls or triggers.
Note: The hard-coded table schema is as follows:
(
Id <64-bit integer>,
lvector <array[dimensions] of 32-bit floats>, metadata <long variable-length UTF8>
)
lvector_drop_tableSignature:
CREATE PROCEDURE lvector_drop_table(table_name LVARCHAR); Purpose: Drops a specific LanceDB/lvector table.
Example:
EXECUTE PROCEDURE lvector_drop_table('docs_demo');
-
lvector_drop_all_tables
Signature:
CREATE FUNCTION lvector_drop_all_tables();
Purpose: Drops all LanceDB/lvector tables managed by the extension. Example:
EXECUTE FUNCTION lvector_drop_all_tables();
Note: Destructive operation. Use only for test cleanup or controlled reset scenarios.
lvector_list_tablesSignature:
CREATE FUNCTION lvector_list_tables();
Purpose: Lists LanceDB/lvector tables known to the extension. Example:
EXECUTE FUNCTION lvector_list_tables();
- lvector_table_info
Signature:
CREATE FUNCTION lvector_table_info(table_name LVARCHAR); Purpose: Returns metadata for a lvector table.
Example:
EXECUTE FUNCTION lvector_table_info('docs_demo');
Note: Note: Expected fields include table_name, version, row_count, and index_count. If index_count stays 0 after index creation, the index did not complete successfully.