@@ -136,8 +136,7 @@ bool tvector_int_to_params(int64_t value,
136136
137137// Validate type parameters and compute storage characteristics.
138138bool tvector_resolve_params (const std::map<std::string, std::string> ¶ms,
139- villagesql::ResolvedTypeParams *result,
140- char *error_msg) {
139+ vsql::ResolvedTypeParams *result, char *error_msg) {
141140 auto it = params.find (" dimension" );
142141 if (it == params.end ()) {
143142 snprintf (error_msg, VEF_MAX_ERROR_LEN,
@@ -178,7 +177,7 @@ bool tvector_resolve_params(const std::map<std::string, std::string> ¶ms,
178177// STRING -> TVECTOR
179178// Dimension and element type are read from type parameters.
180179bool tvector_from_string (const TVectorParams &p, std::string_view from,
181- villagesql ::Span<unsigned char > buf, size_t *length) {
180+ vsql ::Span<unsigned char > buf, size_t *length) {
182181 // Computed values could be cached in the TVectorParams
183182 size_t byte_size = static_cast <size_t >(p.dimension ) * p.bytes_per_elem ;
184183 if (buf.size () < byte_size) return true ;
@@ -229,8 +228,8 @@ bool tvector_from_string(const TVectorParams &p, std::string_view from,
229228// TVECTOR -> STRING
230229// Dimension and element type are read from type parameters.
231230bool tvector_to_string (const TVectorParams &p,
232- villagesql ::Span<const unsigned char > data,
233- villagesql ::Span<char > out, size_t *out_len) {
231+ vsql ::Span<const unsigned char > data,
232+ vsql ::Span<char > out, size_t *out_len) {
234233 const size_t bpe = p.bytes_per_elem ;
235234 if (data.size () != static_cast <size_t >(p.dimension ) * bpe) return true ;
236235
@@ -268,9 +267,8 @@ bool tvector_to_string(const TVectorParams &p,
268267// TODO(villagesql-performance): we can also consider having templated versions
269268// of these functions instead of using branches, then selecting the version to
270269// use with one branch.
271- int tvector_compare (const TVectorParams &p,
272- villagesql::Span<const unsigned char > a,
273- villagesql::Span<const unsigned char > b) {
270+ int tvector_compare (const TVectorParams &p, vsql::Span<const unsigned char > a,
271+ vsql::Span<const unsigned char > b) {
274272 for (int64_t i = 0 ; i < p.dimension ; i++) {
275273 if (p.bytes_per_elem == 8 ) {
276274 double v1 = load_double (a.data () + i * p.bytes_per_elem );
@@ -301,9 +299,9 @@ std::string tvector_default(const TVectorParams &p, char * /*error_msg*/) {
301299
302300// Dot product: (TVECTOR, TVECTOR) -> REAL
303301// Returns the sum of element-wise products of two vectors of the same type.
304- void tvector_dot_product (villagesql ::CustomArgWith<TVectorParams> a,
305- villagesql ::CustomArgWith<TVectorParams> b,
306- villagesql ::RealResult out) {
302+ void tvector_dot_product (vsql ::CustomArgWith<TVectorParams> a,
303+ vsql ::CustomArgWith<TVectorParams> b,
304+ vsql ::RealResult out) {
307305 if (a.is_null () || b.is_null ()) {
308306 out.set_null ();
309307 return ;
@@ -331,9 +329,9 @@ void tvector_dot_product(villagesql::CustomArgWith<TVectorParams> a,
331329
332330// Element-wise add: (TVECTOR, TVECTOR) -> TVECTOR
333331// Vectors must have the same dimension and element type.
334- void tvector_add (villagesql ::CustomArgWith<TVectorParams> a,
335- villagesql ::CustomArgWith<TVectorParams> b,
336- villagesql ::CustomResultWith<TVectorParams> out) {
332+ void tvector_add (vsql ::CustomArgWith<TVectorParams> a,
333+ vsql ::CustomArgWith<TVectorParams> b,
334+ vsql ::CustomResultWith<TVectorParams> out) {
337335 if (a.is_null () || b.is_null ()) {
338336 out.set_null ();
339337 return ;
@@ -365,9 +363,8 @@ void tvector_add(villagesql::CustomArgWith<TVectorParams> a,
365363}
366364
367365// Scalar multiply: (TVECTOR, REAL) -> TVECTOR
368- void tvector_scale (villagesql::CustomArgWith<TVectorParams> a,
369- villagesql::RealArg scalar,
370- villagesql::CustomResultWith<TVectorParams> out) {
366+ void tvector_scale (vsql::CustomArgWith<TVectorParams> a, vsql::RealArg scalar,
367+ vsql::CustomResultWith<TVectorParams> out) {
371368 if (a.is_null () || scalar.is_null ()) {
372369 out.set_null ();
373370 return ;
0 commit comments