Repository navigation
Description
Feature Request: Nested-Field groupBy (Dot Notation)
Follow-up to #4067, which shipped flat-property groupBy on vector.neighbors, vector.sparseNeighbors, and vector.fuse. This issue tracks support for nested-field paths like metadata.author or provenance.source.id.
Background
The MVP from #4067 looks up the grouping key with a flat record.get(groupBy) call. For schemas where the diversification field lives inside a nested map / embedded document, the user has to flatten the field manually before indexing.
Qdrant supports nested paths in group_by via dot notation (metadata.subfield), as does Milvus's group_by_field. ArcadeDB's MATCH / LET / SQL property access already supports dotted paths via Document.get(path) or via projection expressions, so the lookup primitive is available; what's missing is the path-aware reader inside the grouping helpers.
Design
Path resolution
Two equivalent options:
- Reuse
Document.get(String)directly if it already handles dotted paths (verify againstDocument/MutableDocument/ nestedMap<String, Object>semantics). If yes, the change inSQLFunctionVectorNeighbors,SQLFunctionVectorSparseNeighbors, andSQLFunctionVectorFuseis purely the behavioural test plus a docstring update. - Add an explicit dotted-path reader that splits on
.and descends throughMap/Document/EmbeddedDocument/List(with index syntaxpath[N]deferred to a follow-up). Mirror what the SQL projection executor does formetadata.authoraccess.
Pick whichever matches the existing SQL-side dotted-path reader so the behaviour is consistent everywhere in the engine.
Type semantics
Nested paths can resolve to any property type. Document groupBy paths must resolve to a value that has a stable equals / hashCode:
STRING,INTEGER,LONG,BOOLEAN,FLOAT,DOUBLE,DATETIMEtypes: fine.MAP/EMBEDDED/LIST: rejected with a clear error at first lookup time. (Or auto-stringified, which is friendlier but more error-prone; pick stringification only if it matches the existing SQL behaviour.)null: treated as its own group key (matches Qdrant).
Edge cases
- Path that does not exist on a record: that record's group key is
null, and the row joins thenullgroup. - Path that resolves to an array: error or stringify (decide based on SQL precedent).
- Mixed types across documents at the same path: group by Java
equals/hashCode, which means1and1.0are in different groups. Document this.
Acceptance criteria
-
groupBy: 'metadata.author'(or any dotted path) works onvector.neighbors. - Same on
vector.sparseNeighbors. - Same on
vector.fuse(post-fusion grouping). - Behaviour matches the existing SQL projection /
LETexpression resolution for the same path. - Test: 100 docs across nested groups (
metadata.author),groupBy='metadata.author'returns one row per author. - Test: documents with the path missing fall into the
nullgroup. - Test: backwards compatibility with flat property names.
Out of scope
- List indexing in the path (
provenance.sources[0].id). - Glob / wildcard paths.
- Type coercion (e.g., normalize
Integer 1andDouble 1.0into the same group).
Activity
Fixed issue #4072
feat: sparse vector index + hybrid fusion + group-by (#4065, #4066, #…
lvca commentedon May 4, 2026
Implemented in this PR via SQLFunctionVectorAbstract.readNestedField + SQLFunctionVectorNestedGroupByTest (5 tests)
feat: sparse vector index + hybrid fusion + group-by (#4065, #4066, #…
chore(deps): bump com.google.api.grpc:proto-google-common-protos from…
feat: sparse vector index + hybrid fusion + group-by (ArcadeData#4065, …
build(deps): bump com.google.api.grpc:proto-google-common-protos from…