Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions changelog.d/754.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Get started page of the documentation now holds the quickstart, and every generated reference page (SQL functions, Python, Rust, configuration, metrics, Spark Connect coverage) carries a description.
2 changes: 1 addition & 1 deletion crates/krishiv-cli/tests/check_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ fn an_unwritable_report_exits_2() {
fn the_docs_examples_pass_check_compat() {
let docs = repo_root().join("docs");
let scratch = tempfile::tempdir().expect("tempdir");
for (i, page) in ["get-started/quickstart.md", "guides/pyspark-migration.md"]
for (i, page) in ["get-started/index.md", "guides/pyspark-migration.md"]
.iter()
.enumerate()
{
Expand Down
3 changes: 2 additions & 1 deletion crates/krishiv-common/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,8 @@ pub fn docs_markdown() -> String {
let mut entries: Vec<&ConfigEntry> = REGISTRY.to_vec();
entries.sort_by_key(|e| e.key);
let mut out = String::from(
"# Krishiv configuration reference\n\n\
"---\ndescription: \"Every krishiv.* configuration key, with its type, default, scope and Spark alias.\"\n---\n\n\
# Krishiv configuration reference\n\n\
<!-- @generated by `cargo xtask docs-config`; do not edit. -->\n\n\
Keys under `krishiv.experimental.` are experimental and off by default. \
Spark aliases are accepted in place of the Krishiv key; other unknown \
Expand Down
2 changes: 1 addition & 1 deletion crates/krishiv-common/src/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ fn registry_is_well_formed() {
#[test]
fn docs_markdown_lists_every_entry_deterministically() {
let md = docs_markdown();
assert!(md.starts_with("# Krishiv configuration reference\n"));
assert!(md.contains("\n# Krishiv configuration reference\n"));
assert!(md.contains(
"| Key | Type | Default | Scope | Settable by | Since | Spark alias | Description |"
));
Expand Down
3 changes: 2 additions & 1 deletion crates/krishiv-exec/src/metrics/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,8 @@ impl MetricsRegistry {
#[must_use]
pub fn catalogue_markdown() -> String {
let mut out = String::from(
"# Krishiv engine metrics (v1)\n\n\
"---\ndescription: \"Every engine metric: name, type, unit, labels and what it counts.\"\n---\n\n\
# Krishiv engine metrics (v1)\n\n\
<!-- @generated by `cargo xtask docs-metrics`; do not edit. -->\n\n\
Engine metrics, scraped per engine (`Session::metrics`, `krishiv.metrics()`): \
OTel-style dotted names with the mechanical Prometheus rendering next to them \
Expand Down
3 changes: 1 addition & 2 deletions docs/get-started/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"index": "Get started",
"quickstart": "Quickstart"
"index": "Get started"
}
73 changes: 68 additions & 5 deletions docs/get-started/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,77 @@
---
description: "Install Krishiv, run your first query and decide where to go next."
description: "Install Krishiv, run your first SQL and DataFrame query, and decide where to go next."
---

# Get started

This section is for someone who has not run Krishiv yet. The [Quickstart](quickstart.md) installs the Python package,
starts a session, runs a SQL query and a DataFrame query, and reads the result back as Arrow data. It takes a few
minutes and needs Python 3.11 or newer.
This section is for someone who has not run Krishiv yet. The steps below install the Python package, start a session,
run a SQL query and a DataFrame query, and read the result back as Arrow data. They take a few minutes.

Once it runs, pick the next step by what you came to do:
<!-- The code blocks equal the Quickstart section of the repository README (a test checks it); CI runs the README's. -->

Install the package with pyarrow for the Arrow results:

```bash
pip install "krishiv[pyarrow]"
Comment on lines +12 to +15

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain the source-build instructions until a package is published

For new users following this page, the installation instructions now offer only pip install "krishiv[pyarrow]", although both README.md and docs/index.md still explicitly state that nothing has been published to PyPI. The deleted quickstart explained that users must build and install the wheel from the repository first; removing that guidance leaves the getting-started flow without an available installation path. Preserve the source-build instructions and qualify the PyPI command until the package is released.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed: nothing is on PyPI yet, so the build-from-source note (maturin build in python/) goes back on this page, matching README.md and docs/index.md. The edit is made; the commit is waiting on a permission block in my session and will be pushed to this branch as soon as it clears.

```

Krishiv needs Python 3.11 or newer (the floor of the Spark 4.3 Python client); the examples run on 3.11 to 3.14. The `pyarrow` extra is needed for `collect()` and `toArrow()`, which return Arrow data.

SQL and DataFrames:

```python
import tempfile
from pathlib import Path

import pyarrow as pa
import pyarrow.parquet as pq

import krishiv
from krishiv.sql import functions as F

spark = krishiv.session() # a PySpark-style SparkSession, in process

# SQL.
spark.sql("SELECT 1 AS answer").show()

# DataFrames over a Parquet file; the same file is also a temp view for SQL.
path = str(Path(tempfile.mkdtemp()) / "orders.parquet")
pq.write_table(
pa.table(
{
"region": ["east", "west", "east", "north", "west"],
"amount": [10.0, 20.0, 5.5, 7.25, 30.0],
}
),
path,
)
orders = spark.read.parquet(path)
orders.createOrReplaceTempView("orders")

by_region = (
orders.filter(F.col("amount") > 6)
.groupBy("region")
.agg(F.sum("amount").alias("revenue"))
.orderBy("region")
)
by_region.show()
print(by_region.toArrow()) # a pyarrow.Table; also pa.table(by_region), polars.DataFrame(by_region)

same = spark.sql("SELECT region, sum(amount) AS revenue FROM orders WHERE amount > 6 GROUP BY region ORDER BY region")
assert same.collect() == by_region.collect()
```

`EXPLAIN` and `EXPLAIN ANALYZE` (per-operator rows, time, peak memory and spill bytes):

```python
by_region.explain() # the physical plan
by_region.explain(analyze=True) # runs the query and prints each operator's metrics

plan = spark.sql("EXPLAIN ANALYZE SELECT region, sum(amount) FROM orders GROUP BY region").collect()[0][0]
assert plan.startswith("== Physical Plan (analyzed) ==")
```

## Next

- Moving an existing Spark job: [migrate a PySpark job](../guides/pyspark-migration.md), and scan your code first with
[check-compat](../guides/check-compat.md).
Expand Down
74 changes: 0 additions & 74 deletions docs/get-started/quickstart.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Task-by-task guides for migrating, checking, deploying and diagnos

# Guides

Each guide solves one task and is written for someone who already ran the [Quickstart](../get-started/quickstart.md).
Each guide solves one task and is written for someone who already ran the [Quickstart](../get-started/index.md).
Moving a Spark job? Start with [Migrate a PySpark job](pyspark-migration.md) and run
[check-compat](check-compat.md) over your project first. Choosing where Krishiv runs: [Deployment](deploy.md)
(embedded, single-node, distributed). To work with it interactively, see
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ write.
## Install

Nothing is on PyPI yet, so build the wheel from the repository (`maturin build` in `python/`) and install it. Once
released, `pip install "krishiv[pyarrow]"` is all it takes; the [Quickstart](get-started/quickstart.md) has the steps.
released, `pip install "krishiv[pyarrow]"` is all it takes; the [Quickstart](get-started/index.md) has the steps.

## Where to start

Expand Down
4 changes: 4 additions & 0 deletions docs/reference/config/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "Every krishiv.* configuration key, with its type, default, scope and Spark alias."
---

# Krishiv configuration reference

<!-- @generated by `cargo xtask docs-config`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/connect/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"index": "Spark Connect",
"coverage": "Coverage"
}
4 changes: 4 additions & 0 deletions docs/reference/connect/coverage.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "Which Spark Connect relations, commands and expressions Krishiv supports, one row per protocol arm."
---

<!-- Generated by `cargo xtask connect-coverage`; do not edit. -->
# Spark Connect coverage

Expand Down
10 changes: 10 additions & 0 deletions docs/reference/connect/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description: "How much of the Spark Connect protocol Krishiv serves, arm by arm, for the vendored protocol version."
---

# Spark Connect

Spark Connect lets a Spark client talk to an engine over gRPC. Krishiv serves a subset of the protocol today: the
[coverage page](coverage.md) lists every relation, command and expression the translator dispatches on and whether
Krishiv handles it, partly handles it, does not handle it yet or leaves it out of scope. A request that uses an arm
Krishiv does not handle fails with `CONNECT_INVALID_PLAN.INVALID_ONE_OF_FIELD_NOT_SUPPORTED`.
4 changes: 4 additions & 0 deletions docs/reference/metrics-v1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "Every engine metric: name, type, unit, labels and what it counts."
---

# Krishiv engine metrics (v1)

<!-- @generated by `cargo xtask docs-metrics`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "Every public module of the krishiv Python package: classes, functions and signatures."
---

# Python API reference

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.errors.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "Exceptions, shaped like `pyspark.errors` (Spark 4.2); no dependency on `pyspark`."
---

# `krishiv.errors`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "Krishiv: a Rust-native, Spark-compatible batch and streaming engine."
---

# `krishiv`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.column.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`Column`: a column expression, as `pyspark.sql.Column` (a thin wrapper on the native handle)."
---

# `krishiv.sql.column`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.conf.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`RuntimeConfig`: `spark.conf`."
---

# `krishiv.sql.conf`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.dataframe.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`DataFrame`: a lazily evaluated query, as `pyspark.sql.DataFrame`."
---

# `krishiv.sql.dataframe`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`pyspark.sql.functions`: column builders. A function resolves by name in the engine's"
---

# `krishiv.sql.functions`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.group.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`GroupedData`: a DataFrame grouped by key columns, as `pyspark.sql.GroupedData`."
---

# `krishiv.sql.group`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "The PySpark-shaped API: `from krishiv.sql import functions as F`."
---

# `krishiv.sql`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.na.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`DataFrameNaFunctions` (`DataFrame.na`): handling of missing data, as `pyspark.sql.DataFrameNaFunctions`."
---

# `krishiv.sql.na`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.pandas.functions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`pyspark.sql.pandas.functions`: `pandas_udf` and `arrow_udf`."
---

# `krishiv.sql.pandas.functions`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.pandas.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`pyspark.sql.pandas`: the pandas and Arrow vectorized UDFs (`krishiv.sql.pandas.functions`)."
---

# `krishiv.sql.pandas`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.profile_view.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "An offline viewer for `krishiv.query-profile` documents."
---

# `krishiv.sql.profile_view`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.readwriter.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`DataFrameReader` (`spark.read`), `DataFrameWriter` (`df.write`)"
---

# `krishiv.sql.readwriter`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.row.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`Row`: a result row, as `pyspark.sql.Row` (a tuple with field names)."
---

# `krishiv.sql.row`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.session.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`SparkSession`: the entry point, as `pyspark.sql.SparkSession` (embedded: no server)."
---

# `krishiv.sql.session`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/python/krishiv.sql.stat.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: "`DataFrameStatFunctions` (`DataFrame.stat`), as `pyspark.sql.DataFrameStatFunctions`."
---

# `krishiv.sql.stat`

<!-- @generated by `python3 tests/scripts/gen_python_docs.py`; do not edit. -->
Expand Down
Loading
Loading