pgvector.git / summary / log / commit / refs
commit cf494f15ac80ac80d027ff07c94a0d4df9e1e15c
Author: Andrew Kane <andrew@ankane.org>
Date: Fri Apr 26 04:42:10 2024 +0000
Added aggregate test for halfvec [skip ci]
test/t/018_aggregates.pl | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/test/t/018_aggregates.pl b/test/t/018_aggregates.pl
index 04658900..88371111 100644
--- a/test/t/018_aggregates.pl
+++ b/test/t/018_aggregates.pl
@@ -41,6 +41,15 @@ sub test_aggregate
# Test explain
my $explain = $node->safe_psql("postgres", "EXPLAIN SELECT $agg(v) FROM tst;");
like($explain, qr/Partial Aggregate/);
+
+ # Test halfvec
+ $res = $node->safe_psql("postgres", "SELECT $agg(v::halfvec) FROM tst;");
+ if ($agg eq 'avg')
+ {
+ like($res, qr/\[1\.5/);
+ like($res, qr/,2\.5/);
+ like($res, qr/,3\.5/);
+ }
}
test_aggregate('avg');
[parent: 13bd194d00dd]