Skip to content

Open the README with a quick start that runs - #33

Closed
ShawnChen-Sirius wants to merge 1 commit into
chdb-io:mainfrom
ShawnChen-Sirius:readme/quick-start
Closed

ShawnChen-Sirius wants to merge 1 commit into
chdb-io:mainfrom
ShawnChen-Sirius:readme/quick-start

Conversation

@ShawnChen-Sirius

@ShawnChen-Sirius ShawnChen-Sirius commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #30, which fixed this and was closed rather than merged; the problem is still on main.

The problem

The README's first code block queries url('https://example.com/logs.jsonl'), three lines below "no server, no network". That URL 404s, so the first thing a reader copies fails:

SQLException: Code: 86. DB::HTTPException: Received error from remote server
https://example.com/logs.jsonl. HTTP status code: 404 'Not Found'

The snippet was right about what to show — querying JSON with no schema and no load step is the reason to reach for this driver — and wrong only about where the JSON came from. url() itself is fine; verified against a live endpoint while preparing this.

The change

It keeps its shape: a bound parameter, JSONEachRow, an aggregate. The data moves inline, through format(JSONEachRow, ?), which needs no file and no network and is the only variant of this that runs verbatim out of a README. It groups rather than counting, so the result is visibly the engine's work and not a JSON parser's.

It also gains a ## Quick start heading, so it is in the anchor list rather than just being the first thing on the page.

One line notes that swapping format(JSONEachRow, ?) for file(?, …) or url(?, …) leaves the rest of the query unchanged — the production shape, with nothing that can rot.

Deliberately not repeated here, because each already has a home:

Already in Not duplicated in the quick start
Support matrix the four platform artifact ids
Installing groupId, version, the RC repository, the BOM
Connecting the jdbc:chdb: URL forms
Building from source the mvn -pl / build-native.sh sequence

The dependency is a link to #installing, not a second copy of the XML.

The two facts nothing else in the README stated: there is no Class.forName, and chdb-examples/QuickStart.java exists — now linked, where before it was only named in the repository layout table.

Verification

Against 1.0.0-rc.1 resolved from https://maven.chdb.io into a clean local repository, Linux x86_64:

  • the java block extracted from README.md verbatim, wrapped in main, compiles at -source 11 and prints / 2. A text block would not have compiled there, and the support matrix promises Java 11
  • a Maven project declaring only chdb-native-linux-x86_64-gnu — as Installing says is enough — pulls in chdb-jdbc and runs it: 4.4 s cold, 0.24 s warm
  • file(?, 'JSONEachRow') and url(?, 'JSONEachRow'), the two swaps the text offers, both checked against real data rather than asserted

🤖 Generated with Claude Code

Note

Rewrite README quick-start with a Java inline-JSON example

Replaces the previous in-memory connection and URL-backed count query in README.md with a Quick start section that supplies inline JSON through a prepared statement, queries it with format(JSONEachRow, ?), filters successful responses, groups by path, and prints grouped counts. Adds explanatory text for dependency setup, driver registration, engine mapping, alternative file and url table functions, and links to QuickStart.java for more examples.

Macroscope summarized d75e32c.

The first snippet queried `url('https://example.com/logs.jsonl')`, three lines
below "no server, no network". That URL 404s, so the first thing a reader
copied failed with `Code: 86. RECEIVED_ERROR_FROM_REMOTE_IO_SERVER`. The
snippet was right about what to show — querying JSON with no schema and no
load step is the reason to reach for this driver — and wrong only about where
the JSON came from.

So it keeps its shape: a bound parameter, `JSONEachRow`, an aggregate. The
data is now inline, through `format(JSONEachRow, ?)`, which needs no file and
no network, and it groups rather than counting so the result is visibly the
engine's work and not a JSON parser's. `format()` is also the only variant of
this that runs verbatim out of a README.

Two things nothing else in the README said: that there is no `Class.forName`,
and that `chdb-examples/QuickStart.java` exists — now linked, not just named
in the repository layout table. Everything else stays where it lives: the
platform artifact ids in the support matrix, the coordinates in Installing,
the URL forms in Connecting, the build commands in Building from source. The
dependency is a link to `#installing`, not a second copy of the XML.

Verified against 1.0.0-rc.1 resolved from maven.chdb.io: the block extracted
from README.md verbatim compiles at `-source 11` — a text block would not
have, and the support matrix promises Java 11 — and prints `/ 2`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant