Skip to content

Docs: the facets user guide and an example (closes #293) - #303

Merged
tae898 merged 1 commit into
mainfrom
docs/293-facets-guide
Nov 7, 2026
Merged

tae898 merged 1 commit into
mainfrom
docs/293-facets-guide

Conversation

@tae898

@tae898 tae898 commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #293. Part of #289.

I added the user guide for columnar faceting, a test that runs every block of it, and a runnable example.

  • docs/modules/ROOT/pages/how-to/facets.adoc (in the nav next to the COLUMNAR index page, linked both ways): what a facet is, the prerequisites (engine 26.12.1 or later, a COLUMNAR index), one runnable walkthrough on a ten-record data set for TERMS, RANGES, HISTOGRAM (calendar), FILTER (disjunctive), HIERARCHY, DISTINCT (with PRECISION), STATS, AFTER paging and facet.searchValues, the ResultSet.facets dict shape as a table, unavailable facets and their reason, the rows-first rule, parameters (named and positional; TOP and PRECISION take an integer literal), the older-engine refusal with a version check, and the known limits (negative zero, DISTINCT above PRECISION). The SQL texts and the asserted values come from tests/test_result_set_facets.py, tests/test_result_set_facets_kinds.py and tests/test_columnar_index.py. There is no speed claim, and no claim about a release beyond "needs engine 26.12.1 or later".
  • tests/test_docs_facets_page.py runs the 19 Python blocks in order on one database, as the neighbouring page tests do, and compares each output block. A block that needs the new engine has the title "Needs engine 26.12.1 or later" and role=needs-engine. On an older engine the test asserts the documented refusal (SQL syntax error, or the COLUMNAR index type refusal) for that block instead of its output. There is no skip, and the page's own engine_version check is compared with the test's.
  • examples/30_columnar_facets.py loads 1,200 generated products, creates the COLUMNAR indexes, runs three faceted queries and prints the rows and the facets. It checks every count against the same count made in Python. On an engine older than 26.12.1 it prints one line and exits 0. It is listed in examples/README.md and counted in README.md, which also gets one line in the feature list.
  • The examples globs in test-python-examples.yml and test-native.yml ended at 2[0-9]_*.py, so a 30th example would never have run. They now include 3[0-9]_*.py.

Verified: compile() of both Python files, pyflakes, pre-commit (black, isort, actionlint, the old-package-name guard) and bandit on both files, and a dry extraction of the page blocks (19 blocks, 15 with output, 14 needing the new engine). Not verified: nothing was run against an engine on the laptop. The page test and the example run for real in CI, on the JVM lane against the latest snapshot and on the native gate against 26.11.1 (refusal branch). The outputs that were derived from the tests but not run before are the first ones to check if CI fails: the paging output on category (TOP 2, two pages), PRECISION 5 and PRECISION 10 on the price column, the tags terms and searchValues outputs on FacetDoc, and the three-facet combinations of the example.

🤖 Generated with Claude Code

The guide walks one small data set through every facet kind (TERMS, RANGES,
HISTOGRAM, FILTER, HIERARCHY, DISTINCT, STATS, AFTER paging, facet.searchValues),
the result_set.facets dict shape, unavailable facets, the rows-first rule, the
parameters and the older-engine refusal. Every SQL text and output is taken from
what tests/test_result_set_facets*.py and tests/test_columnar_index.py already
prove on both packages; no speed claim and no release claim beyond engine 26.12.1.

Engine gating without skips: a block that needs 26.12.1 carries role=needs-engine
and a visible title. tests/test_docs_facets_page.py runs every block in order on
both packages; on an older engine it asserts the documented refusal ("SQL syntax
error" or the COLUMNAR index type refusal) for those blocks instead of their
output, so the native PR gate (engine 26.11.1) and the JVM lane (26.12.1-SNAPSHOT)
both run the same file.

examples/30_columnar_facets.py checks every facet count against the same count
made in Python, and prints one line and exits 0 on an older engine. The examples
globs of test-python-examples.yml and test-native.yml stopped at 2[0-9], so a
30th example would never have run: they now include 3[0-9].

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tae898
tae898 merged commit c62240a into main Nov 7, 2026
52 checks passed
@tae898
tae898 deleted the docs/293-facets-guide branch November 7, 2026 03:35
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Columnar faceting: Python user guide and example

1 participant