You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-vector-engine-guide/sap-hana-cloud-sap-hana-database-vector-engine-guide[SAP HANA Cloud QRC 4/2024+]
24
+
* https://learn.microsoft.com/en-us/sql/t-sql/data-types/vector-data-type?view=sql-server-ver17[SQL Server 2025+]
21
25
22
26
In theory, the vector-specific functions could be implemented to work with every database that supports arrays.
27
+
Since the performance strongly depends on the existence of a vector index and the search is potentially probabilistic,
28
+
no emulation has been implemented yet.
23
29
24
30
[WARNING]
25
31
====
@@ -93,40 +99,37 @@ Expressions of the vector type can be used with various vector functions.
93
99
|===
94
100
| Function | Purpose
95
101
96
-
| `cosine_distance()` | Computes the https://en.wikipedia.org/wiki/Cosine_similarity[cosine distance] between two vectors. Maps to the `<``=``>` operator for `pgvector` and maps to the `vector_distance(v1, v2, COSINE)` function for `Oracle AI Vector Search`.
102
+
| `cosine_distance()` | Computes the https://en.wikipedia.org/wiki/Cosine_similarity[cosine distance] between two vectors.
97
103
98
-
| `euclidean_distance()` | Computes the https://en.wikipedia.org/wiki/Euclidean_distance[euclidean distance] between two vectors. Maps to the `<``-``>` operator for `pgvector` and maps to the
99
-
`vector_distance(v1, v2, EUCLIDEAN)` function for `Oracle AI Vector Search`.
104
+
| `euclidean_distance()` | Computes the https://en.wikipedia.org/wiki/Euclidean_distance[euclidean distance] between two vectors.
100
105
101
106
| `euclidean_squared_distance()` | Computes the https://en.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance[squared euclidean distance] between two vectors.
102
107
103
-
| `l2_distance()` | Alias for `euclidean_distance()`
108
+
| `l2_distance()` | Alias for `euclidean_distance()`.
104
109
105
-
| `l2_squared_distance()` | Alias for `euclidean_squared_distance()`
110
+
| `l2_squared_distance()` | Alias for `euclidean_squared_distance()`.
106
111
107
-
| `taxicab_distance()` | Computes the https://en.wikipedia.org/wiki/Taxicab_geometry[taxicab distance] between two vectors. Maps to `vector_distance(v1, v2, MANHATTAN)` function for `Oracle AI Vector Search`.
112
+
| `taxicab_distance()` | Computes the https://en.wikipedia.org/wiki/Taxicab_geometry[taxicab distance] between two vectors.
108
113
109
-
| `l1_distance()` | Alias for `taxicab_distance()`
114
+
| `l1_distance()` | Alias for `taxicab_distance()`.
110
115
111
-
| `hamming_distance()` | Computes the https://en.wikipedia.org/wiki/Hamming_distance[hamming distance] between two vectors. Maps to `vector_distance(v1, v2, HAMMING)` function for `Oracle AI Vector Search`.
116
+
| `hamming_distance()` | Computes the https://en.wikipedia.org/wiki/Hamming_distance[hamming distance] between two vectors.
112
117
113
-
| `jaccard_distance()` | Computes the https://en.wikipedia.org/wiki/Jaccard_index[jaccard distance] between two vectors. Maps to the `<``%``>` operator for `pgvector` and maps to the
114
-
`vector_distance(v1, v2, JACCARD)` function for `Oracle AI Vector Search`.
118
+
| `jaccard_distance()` | Computes the https://en.wikipedia.org/wiki/Jaccard_index[jaccard distance] between two vectors.
115
119
116
-
| `inner_product()` | Computes the https://en.wikipedia.org/wiki/Inner_product_space[inner product] between two vectors
120
+
| `inner_product()` | Computes the https://en.wikipedia.org/wiki/Inner_product_space[inner product] between two vectors.
117
121
118
-
| `negative_inner_product()` | Computes the negative inner product. Maps to the `<``#``>` operator for `pgvector` and maps to the
119
-
`vector_distance(v1, v2, DOT)` function for `Oracle AI Vector Search`.
122
+
| `negative_inner_product()` | Computes the negative inner product.
120
123
121
-
| `vector_dims()` | Determines the dimensions of a vector
124
+
| `vector_dims()` | Determines the dimensions of a vector.
122
125
123
-
| `vector_norm()` | Computes the https://en.wikipedia.org/wiki/Euclidean_space#Euclidean_norm[Euclidean norm] of a vector
126
+
| `vector_norm()` | Computes the https://en.wikipedia.org/wiki/Euclidean_space#Euclidean_norm[Euclidean norm] of a vector.
124
127
125
-
| `l2_norm()` | Alias for `vector_norm()`
128
+
| `l2_norm()` | Alias for `vector_norm()`.
126
129
127
130
| `l2_normalize()` | Normalizes each component of a vector by dividing it with the https://en.wikipedia.org/wiki/Euclidean_space#Euclidean_norm[Euclidean norm] of the vector.
128
131
129
-
| `binary_quantize()` | Reduces a vector of size N to a binary vector with N bits, using 0 for values <= 0 and 1 for values > 0.
132
+
| `binary_quantize()` | Reduces a vector of size N to a binary vector with N bits, using 0 for values \<= 0 and 1 for values > 0.
130
133
131
134
| `subvector()` | Creates a subvector from a given vector, a 1-based start index and a count.
Copy file name to clipboardExpand all lines: whats-new.adoc
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,42 @@ Describes the new features and capabilities added to Hibernate ORM in {version}.
11
11
12
12
IMPORTANT: If migrating from earlier versions, be sure to also check out the link:{migrationGuide}[Migration Guide] for discussion of impactful changes.
13
13
14
+
[[vector-module-enhancements]]
15
+
== Hibernate-Vector module enhancements
16
+
17
+
Support for binary, float16 and sparse vectors were added.
18
+
19
+
====
20
+
[source, java, indent=0]
21
+
----
22
+
@Entity
23
+
public class MyEntity {
24
+
@Id
25
+
UUID id;
26
+
@JdbcTypeCode(SqlTypes.VECTOR_BINARY)
27
+
@Array(length = 24) // Refers to the bit count
28
+
byte[] binaryVector;
29
+
@JdbcTypeCode(SqlTypes.VECTOR_FLOAT16)
30
+
@Array(length = 3)
31
+
float[] float16Vector;
32
+
@Array(length = 3)
33
+
SparseFloatVector sparseFloat32Vector;
34
+
}
35
+
----
36
+
====
37
+
38
+
The Hibernate Vector module currently ships with 3 sparse vector types:
39
+
40
+
* `SparseByteVector`
41
+
* `SparseFloatVector`
42
+
* `SparseDoubleVector`
43
+
44
+
In addition to accessing the sparse indices and values, they also implement the `List` interface to provide access
45
+
as if it were a dense vector.
46
+
47
+
Also, support for vectors in the following databases was added:
0 commit comments