Expand description
l2_distance / cosine_distance scalar UDFs (docs/SPEC.md §2.8).
The SQL and DataFrame surface of the vector-distance operator. Both take a
FixedSizeList<Float32> vector and a query vector (any list of numbers —
coercion casts it to FixedSizeList<Float32> with the column’s dimension)
and return a nullable Float32 distance. The scalar implementation calls
the same reference arithmetic as the CPU kernel, so a projection the
placement rule lowers to crate::GpuVectorDistanceExec computes exactly
what the un-lowered projection would.
Constants§
- COSINE_
DISTANCE - Name of the cosine distance (
1 - cos(θ)) UDF. - L2_
DISTANCE - Name of the L2 (Euclidean) distance UDF.
Functions§
- cosine_
distance_ udf - The
cosine_distancescalar UDF. - distance_
metric_ for - The metric a UDF name stands for, if it is one of ours.
- distance_
udf_ name - The UDF name for
metric. - l2_
distance_ udf - The
l2_distancescalar UDF. - literal_
query - Extracts the query vector from a
ScalarValue::FixedSizeListliteral: one non-null row of non-nullFloat32s, as the placement rule requires. - oxide_
udfs - Every OxideLake SQL UDF — registered on embedded sessions, cluster clients, the scheduler’s session builder and every executor’s function registry.
- query_
literal - The query vector as the
FixedSizeList<Float32>literal our planner rule recognizes (ScalarValue::FixedSizeList, no nulls).