Skip to content

Commit c62240a

Browse files
tae898claude
andauthored
Docs: the facets user guide, its page test and example 30 (closes #293) (#303)
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>
1 parent 95c562e commit c62240a

9 files changed

Lines changed: 1043 additions & 7 deletions

File tree

‎.github/workflows/test-native.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ jobs:
672672
env:
673673
KEY: ${{ matrix.key }}
674674
PY: ${{ matrix.python }}
675-
EXAMPLES: "0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py"
675+
EXAMPLES: "0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py 3[0-9]_*.py"
676676
EXAMPLES_SKIP_FILE: scripts/native_examples_skip.txt
677677
# The Hugging Face cache inside the workspace, as in test-python-examples.yml: one path on every platform, cacheable.
678678
HF_HOME: ${{ github.workspace }}/.hf-cache

‎.github/workflows/test-python-examples.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ on:
6060
description: "Glob pattern(s) for examples to run (space-separated, relative to examples)."
6161
required: false
6262
type: string
63-
default: "0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py"
63+
default: "0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py 3[0-9]_*.py"
6464
build-version:
6565
description: "Override package version (PEP 440) for build.sh"
6666
required: false
@@ -76,7 +76,7 @@ on:
7676
examples:
7777
description: "Glob pattern(s) for examples to run (space-separated, relative to examples)."
7878
required: false
79-
default: "0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py"
79+
default: "0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py 3[0-9]_*.py"
8080

8181
# SUPERSEDE, do not race (same rule in test-jvm.yml).
8282
#
@@ -113,7 +113,7 @@ env:
113113
# The image download-jars takes the jars from. Unset (push, pull_request, schedule)
114114
# means latest; a release build passes its tag.
115115
ARCADEDB_IMAGE_TAG: ${{ inputs.arcadedb-tag || 'latest' }}
116-
EXAMPLES: ${{ inputs.examples || '0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py' }}
116+
EXAMPLES: ${{ inputs.examples || '0[1-9]_*.py 1[0-9]_*.py 2[0-9]_*.py 3[0-9]_*.py' }}
117117

118118
# Note: Example 21 runs in CI at reduced scale; its arguments and 15-minute
119119
# limit are set in the per-example case in scripts/run_examples.sh, which the

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ This prints `Name: Alice` (the engine also logs to standard error). `create_data
7474
- Graph, document, key/value, vector (JVector HNSW) and time series models; ACID transactions.
7575
- Import from CSV, XML and ArcadeDB JSONL; export to JSONL.
7676
- Columnar results with `to_columns()`, `to_arrow()` and `to_dataframe()`.
77+
- Faceted queries: the `FACETS` clause of a `SELECT` with a `COLUMNAR` index, and the counts as a dict in `ResultSet.facets` (needs engine 26.12.1 or later).
7778
- An optional in-process HTTP server (`create_server()`), off until you call it, for other processes that need the same data.
7879

7980
<!-- REMOVE WHEN: the old arcadedb-embedded* shims are retired and two releases have shipped with the two-package layout allow-old-name -->
@@ -93,13 +94,13 @@ Releases from this repository start with 26.11.1. The 26.10.x wheels were built
9394

9495
## Documentation
9596

96-
- Here: [`docs/`](https://github.com/ArcadeData/arcadedb-python/tree/main/docs/modules/ROOT/pages) is an Antora component (AsciiDoc) with Installation, [Which package?](https://github.com/ArcadeData/arcadedb-python/blob/main/docs/modules/ROOT/pages/which-package.adoc), Quickstart, Databases and queries, Vectors, and Concurrency, processes and crashes. It covers only what is specific to the Python bindings.
97+
- Here: [`docs/`](https://github.com/ArcadeData/arcadedb-python/tree/main/docs/modules/ROOT/pages) is an Antora component (AsciiDoc) with Installation, [Which package?](https://github.com/ArcadeData/arcadedb-python/blob/main/docs/modules/ROOT/pages/which-package.adoc), Quickstart, Databases and queries, Vectors, Faceted queries, and Concurrency, processes and crashes. It covers only what is specific to the Python bindings.
9798
- Published at [docs.arcadedb.com/arcadedb-python](https://docs.arcadedb.com/arcadedb-python/), the same site as the main ArcadeDB manual, rebuilt daily from `main` (ArcadeData/arcadedb-docs#505). The `Docs` workflow builds it as a site of its own on every change under `docs/` and attaches it as the `docs-site` artifact. To build it locally, run `npx -p @antora/cli@3.2.1 -p @antora/site-generator@3.2.1 antora docs/antora-playbook.yml` and open `docs/build/site/index.html`.
9899
- ArcadeDB itself (SQL, openCypher, schema, server): [docs.arcadedb.com](https://docs.arcadedb.com). It is not repeated here.
99100

100101
## Examples
101102

102-
[`examples/`](https://github.com/ArcadeData/arcadedb-python/tree/main/examples) holds 29 runnable scripts, from a first document store to vector search, time series, graph algorithms and server mode. CI runs them ([`test-python-examples.yml`](https://github.com/ArcadeData/arcadedb-python/blob/main/.github/workflows/test-python-examples.yml)).
103+
[`examples/`](https://github.com/ArcadeData/arcadedb-python/tree/main/examples) holds 30 runnable scripts, from a first document store to vector search, time series, graph algorithms and server mode. CI runs them ([`test-python-examples.yml`](https://github.com/ArcadeData/arcadedb-python/blob/main/.github/workflows/test-python-examples.yml)).
103104

104105
## Build and test from source
105106

‎docs/modules/ROOT/nav.adoc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
** xref:how-to/functions-and-events.adoc[Python functions and record events]
1717
** xref:how-to/vectors.adoc[Vectors]
1818
** xref:how-to/columnar-index.adoc[The COLUMNAR index and its settings]
19+
** xref:how-to/facets.adoc[Faceted queries]
1920
* Development
2021
** xref:development/ci.adoc[Continuous integration]
2122
** xref:development/release.adoc[Release]

‎docs/modules/ROOT/pages/how-to/columnar-index.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Sources: ArcadeDB 26.12.1: GlobalConfiguration.java (COLUMNAR_*), AlterDatabaseStatement.java, ColumnarGroupByStep.java, ColumnarCrashRecoveryTest.java. The statements about Python are pinned by tests/test_columnar_index.py, which runs on arcadedb-jvm and on the native arcadedb.
55

6-
A `COLUMNAR` index keeps a column projection of a type next to its records. The engine applies, flushes and merges it in threads of its own, and the `FACETS` clause and `GROUP BY` read it. It needs engine 26.12.1 or later: an older engine refuses `CREATE INDEX ... COLUMNAR` with `Index type 'COLUMNAR' is not supported`. The facets themselves are read with `ResultSet.facets`.
6+
A `COLUMNAR` index keeps a column projection of a type next to its records. The engine applies, flushes and merges it in threads of its own, and the `FACETS` clause and `GROUP BY` read it. It needs engine 26.12.1 or later: an older engine refuses `CREATE INDEX ... COLUMNAR` with `Index type 'COLUMNAR' is not supported`. The facets themselves are read with `ResultSet.facets`, which xref:how-to/facets.adoc[Faceted queries] shows kind by kind.
77

88
The index is a statement, so it is the same on both builds:
99

0 commit comments

Comments
 (0)