Repository navigation
Docs: the facets user guide and an example (closes #293) - #303
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theCOLUMNARindex page, linked both ways): what a facet is, the prerequisites (engine 26.12.1 or later, aCOLUMNARindex), one runnable walkthrough on a ten-record data set forTERMS,RANGES,HISTOGRAM(calendar),FILTER(disjunctive),HIERARCHY,DISTINCT(withPRECISION),STATS,AFTERpaging andfacet.searchValues, theResultSet.facetsdict shape as a table, unavailable facets and theirreason, the rows-first rule, parameters (named and positional;TOPandPRECISIONtake an integer literal), the older-engine refusal with a version check, and the known limits (negative zero,DISTINCTabovePRECISION). The SQL texts and the asserted values come fromtests/test_result_set_facets.py,tests/test_result_set_facets_kinds.pyandtests/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.pyruns 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" androle=needs-engine. On an older engine the test asserts the documented refusal (SQL syntax error, or theCOLUMNARindex type refusal) for that block instead of its output. There is no skip, and the page's ownengine_versioncheck is compared with the test's.examples/30_columnar_facets.pyloads 1,200 generated products, creates theCOLUMNARindexes, 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 inexamples/README.mdand counted inREADME.md, which also gets one line in the feature list.test-python-examples.ymlandtest-native.ymlended at2[0-9]_*.py, so a 30th example would never have run. They now include3[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 thelatestsnapshot 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 oncategory(TOP 2, two pages),PRECISION 5andPRECISION 10on thepricecolumn, thetagsterms andsearchValuesoutputs onFacetDoc, and the three-facet combinations of the example.🤖 Generated with Claude Code