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
{{ message }}
Repository navigation
Columnar faceting: expose the facets of a result set in both packages #290
Part of #289 (columnar faceting in the Python bindings).
Scope
Expose the facets of a result set in both packages: an accessor on the result set (for example result_set.facets) returning the engine's FacetResults as Python data: meta (exact, patched, lag_ms) and one entry per facet alias with type, source, optional reason, buckets (value or key, from, to, count, plus the missing and default flags), other_count for terms and missing.
Facets that are unavailable (with a reason) are surfaced, not dropped.
Non-finite numbers in facet values (NaN, +/-Infinity) decode to the Python floats, as rows do.
Native package: check how the ctypes bridge exposes a result set and add what is needed to read the facets (for example one entry point returning the facets as JSON). The JVM package reads getFacets() through JPype.
Input parameters in RANGES and INCLUDE work from query(...) and command(...).
Tests
TERMS, RANGES, a calendar HISTOGRAM, a disjunctive FILTER and an unavailable facet, in the JVM and native lanes, comparing against the same query's GROUP BY counts.
I will start here after the CI change. For the native package, ArcadeNative.batchOf closes the cursor when the last batch is read, so I will add the facets to that last reply as JSON from rs.getFacets(), and make the lazy Prefetched cursors pass getFacets() on (without that every facet would be silently lost). NaN and the infinities will travel in the same tag rows use, through FacetResults.toJSON(ValueEncoder), so they decode to Python floats. For arcadedb-jvm I will read getFacets() through a bridge call.
The accessor is result_set.facets, with meta (exact, patched, lag_ms) and one entry per alias, unavailable ones included. I follow the engine's rule: rows first, and asking for facets before the rows are read ends the rows. Tell me if you want a different behaviour.
Two things I will check first: whether getFacets() still works after the engine closes the result set, and whether the native image needs the new parser classes (FacetsClause, FacetItem, FacetRangeItem) in its reflection metadata. Both go into the tests.
Activity
tae898 commentedon Nov 6, 2026
I will start here after the CI change. For the native package,
ArcadeNative.batchOfcloses the cursor when the last batch is read, so I will add the facets to that last reply as JSON fromrs.getFacets(), and make the lazyPrefetchedcursors passgetFacets()on (without that every facet would be silently lost). NaN and the infinities will travel in the same tag rows use, throughFacetResults.toJSON(ValueEncoder), so they decode to Python floats. Forarcadedb-jvmI will readgetFacets()through a bridge call.The accessor is
result_set.facets, withmeta(exact,patched,lag_ms) and one entry per alias,unavailableones included. I follow the engine's rule: rows first, and asking for facets before the rows are read ends the rows. Tell me if you want a different behaviour.Two things I will check first: whether
getFacets()still works after the engine closes the result set, and whether the native image needs the new parser classes (FacetsClause,FacetItem,FacetRangeItem) in its reflection metadata. Both go into the tests.Facets: promise only what both packages guarantee; pick the type-leve…