Summary
tests/bug_0002.phpt is marked --XFAIL-- because zvec v0.2 had GroupByQuery as "Coming Soon" (returned all docs in a single group with empty group_by_value). In zvec v0.4.0, the implementation exists — CollectionImpl::GroupByQuery() calls sql_engine_->execute_group_by(). The test should now pass.
What to do
- Remove
--XFAIL-- lines (3-4) from tests/bug_0002.phpt
- Run the test:
php run-tests.php tests/bug_0002.phpt
- If it passes — done
- If it still fails — investigate and fix
Files affected
tests/bug_0002.phpt — remove --XFAIL-- section
Existing test content
The test creates a collection with category and name string fields and an FP32 vector field, inserts 5 documents across 3 categories, then calls:
$groups = $c->groupByQuery(
'v', [0.5, 0.5, 0.5, 0.5],
groupByField: 'category',
groupCount: 2,
groupTopk: 3,
);
Expects multiple groups with non-empty group_value.
Expected result
Test passes — GroupByQuery returns properly grouped results with correct group_by_value strings.
Dependencies
None — no code changes, just test annotation change and verification.
Rebuild
Only if the FFI library is stale:
Summary
tests/bug_0002.phptis marked--XFAIL--because zvec v0.2 had GroupByQuery as "Coming Soon" (returned all docs in a single group with emptygroup_by_value). In zvec v0.4.0, the implementation exists —CollectionImpl::GroupByQuery()callssql_engine_->execute_group_by(). The test should now pass.What to do
--XFAIL--lines (3-4) fromtests/bug_0002.phptphp run-tests.php tests/bug_0002.phptFiles affected
tests/bug_0002.phpt— remove--XFAIL--sectionExisting test content
The test creates a collection with
categoryandnamestring fields and an FP32 vector field, inserts 5 documents across 3 categories, then calls:Expects multiple groups with non-empty
group_value.Expected result
Test passes —
GroupByQueryreturns properly grouped results with correctgroup_by_valuestrings.Dependencies
None — no code changes, just test annotation change and verification.
Rebuild
Only if the FFI library is stale: