feat(deltagraph): server binary backed by Databricks (Phase 4.1)#336
Merged
Conversation
Adds a `deltagraph` binary alongside the existing `clickgraph` server. Same HTTP + Bolt code path, same Cypher language, but emits Spark SQL via the dialect routing landed in Phase 1.x and executes against a Databricks SQL Warehouse via the executor from Phase 2.x. Defaults `--databricks` on, defaults Neo4j compat mode on (the headline demo is Neo4j Browser → deltagraph → Databricks), and forces an env-only PAT (DATABRICKS_TOKEN is never accepted on the command line). To support both binaries from one library crate: - `ServerConfig.databricks: bool` sits alongside `ServerConfig.embedded` with `CLICKGRAPH_DATABRICKS` env support and a feature-gated dispatch branch in `server::run_with_config`. `AppState.clickhouse_client` stays `None` — only DDL writes consume it, and the Databricks read path blocks writes upstream via the existing write_guard. - New `[[bin]] required-features = ["databricks"]` keeps the default `cargo build` producing only `clickgraph` — no reqwest/Databricks dep is pulled into the standard build. - `clickgraph` also picks up a `--databricks` flag for parity; users on a `--features databricks` build can flip dialects without two binaries. Two assert_cmd smoke tests guard the user's discovery surface: `--help` mentions DATABRICKS_HOST/WAREHOUSE_ID/TOKEN and the env-only policy; missing-credentials startup exits non-zero with a precise error naming the missing field (not a confusing reqwest connection error). Phase 4.3 (full Neo4j Browser → DeltaGraph → Databricks end-to-end demo) builds on this binary. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a Databricks-backed server distribution (“DeltaGraph”) by introducing a feature-gated deltagraph binary that reuses the existing server library and routes execution through the Databricks SQL Warehouse executor while keeping the default clickgraph build unchanged.
Changes:
- Introduces a new
deltagraphbinary (behind--features databricks) with Databricks-first defaults and env-only token policy. - Extends shared server configuration and startup routing to support a Databricks execution backend (
--databricksflag +CLICKGRAPH_DATABRICKSenv). - Adds feature-gated smoke tests validating
deltagraph --helpdiscovery strings and clear missing-credentials startup errors.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rust/bin/deltagraph_smoke.rs | Adds Databricks-feature-gated smoke tests for the new deltagraph binary help text and missing-credentials failure path. |
| STATUS.md | Documents the new deltagraph server binary as part of DeltaGraph / Databricks mode. |
| src/server/mod.rs | Adds a databricks startup branch to build a Databricks executor and run the server without a ClickHouse client; adds env-based Databricks config builder. |
| src/main.rs | Adds --databricks CLI flag to clickgraph for parity (feature-gated at runtime). |
| src/config.rs | Extends ServerConfig / CliConfig with a databricks: bool flag and env parsing (CLICKGRAPH_DATABRICKS). |
| src/bin/deltagraph.rs | Implements the new deltagraph binary wrapper that forces Databricks mode and defaults Neo4j compat on. |
| Cargo.toml | Declares deltagraph as a gated [[bin]], adds dev-deps for smoke tests, and registers the standalone test target behind databricks. |
| Cargo.lock | Locks new dev-dependencies (assert_cmd, predicates) into the workspace. |
Comment on lines
+174
to
+175
| // (gated server-side via write_guard for the Remote executor kind) | ||
| // consume it, and Databricks ports are read-only in this iteration. |
Comment on lines
+111
to
+115
| # Standalone smoke test for the `deltagraph` binary (Phase 4.1). Sits | ||
| # outside tests/rust/ because it spawns a compiled bin via `cargo run` | ||
| # rather than driving library code; cargo's default test discovery | ||
| # would otherwise miss it because tests/rust/ is the explicit root for | ||
| # unit/integration/e2e above. |
Two doc-only fixes from Copilot review: 1. src/server/mod.rs: The DeltaGraph dispatch comment claimed DDL writes are "gated server-side via write_guard for the Remote executor kind." That's wrong on two counts — the server doesn't pass ExecutorKind into the planner (write_guard is only consumed by clickgraph-embedded's constructors), and the actual server-side write rejection is the 501 NOT_IMPLEMENTED in query_handler_inner that triggers whenever AppState.clickhouse_client is None. Rewrite the comment to point at the real mechanism (matches the embedded branch's existing reliance). 2. Cargo.toml: The [[test]] declaration claimed the smoke test "spawns a compiled bin via `cargo run`." It actually uses assert_cmd::Command::cargo_bin, which resolves CARGO_BIN_EXE_deltagraph (a cargo-set env var pointing at the already-built test binary) — no cargo subprocess involved. Correct the wording so future maintainers reading the manifest understand the actual mechanism. No behavior changes. Co-Authored-By: Claude Opus 4.7 <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.
Summary
Ships Phase 4.1 of the DeltaGraph plan — a
deltagraphbinary alongsideclickgraph, both built from the same library. The new binary defaults--databrickson, defaults Neo4j compat mode on (since the headline demo is open Neo4j Browser, run Cypher, hit Databricks under the covers), and forces a token-from-env policy (DATABRICKS_TOKENis never accepted on the command line).Architecture: one library, two binaries:
ServerConfig.databricks: boolsits alongsideServerConfig.embeddedwithCLICKGRAPH_DATABRICKSenv support. A new feature-gated branch inserver::run_with_configbuilds aDatabricksSqlExecutor(from Phase 2.1) and routes it through the existingQueryExecutortrait.AppState.clickhouse_clientstaysNone— only DDL writes consume it, and the Databricks read path blocks writes upstream viawrite_guardalready.[[bin]] required-features = [\"databricks\"]keeps the defaultcargo buildproducing onlyclickgraph— no reqwest/Databricks dep pulled into the standard build.clickgraphalso picks up a--databricksflag for parity (users on a--features databricksbuild can flip dialects without two binaries).Build/run:
Tests
tests/rust/bin/deltagraph_smoke.rs(gated onfeature = \"databricks\", twoassert_cmdtests):deltagraph_help_lists_databricks_specific_env_vars—--helpmentions DATABRICKS_HOST/WAREHOUSE_ID/TOKEN and the env-only policy. Pins the user's discovery surface against accidental help-text rewrites.deltagraph_startup_without_credentials_errors_clearly— missing-creds startup exits non-zero with a precise error naming the missing field (DATABRICKS_HOST not set), not a confusing reqwest connection error.What's deferred to Phase 4.3
A full "Bolt → DeltaGraph → Databricks wiremock" startup integration test belongs in Phase 4.3 (the headline Neo4j Browser e2e demo), where it can drive an actual Cypher query through the live server stack. Spinning up the HTTP + Bolt server for a single request in this PR would be expensive scaffolding for a different feature.
Test plan
cargo build --bin clickgraph(default features) — unchangedcargo build --bin deltagraph --features databricks— produces working binarycargo test --features databricks --test deltagraph_bin— 2 smoke tests passcargo test -p clickgraph --features databricks --lib— 1385 tests passcargo clippy --all-targets --features databricks— 0 warningscargo fmt --all --check— cleandeltagraphbinary🤖 Generated with Claude Code