feat: support JSON2 row writes - #111
Conversation
Signed-off-by: luofucong <luofc@foxmail.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🟡 Changes recommended
Empty or whitespace-only JSON2 input is accepted as SQL NULL and must be rejected.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds native JSON2 ingestion for row writes, including Protobuf encoding, schema metadata, validation, tests, and a quickstart example.
Changes:
- Adds JSON2 parsing, encoding, and schema support.
- Rejects JSON2 in bulk/Arrow writes while preserving legacy JSON.
- Updates dependencies, CI, integration coverage, and documentation example.
File summaries
| File | Summary |
|---|---|
ingester-protocol/src/test/java/io/greptime/models/TableSchemaTest.java |
Tests schema validation. |
ingester-protocol/src/test/java/io/greptime/models/Json2Test.java |
Tests JSON2 encoding and invalid input handling. |
ingester-protocol/src/main/java/io/greptime/models/ValueUtil.java |
Parses and encodes JSON2 values. |
ingester-protocol/src/main/java/io/greptime/models/TableSchema.java |
Adds JSON2 schema metadata and validation. |
ingester-protocol/src/main/java/io/greptime/models/Table.java |
Supports JSON2 column options. |
ingester-protocol/src/main/java/io/greptime/models/RowHelper.java |
Routes JSON2 row values. |
ingester-protocol/src/main/java/io/greptime/models/DataType.java |
Adds the Json2 data type. |
ingester-protocol/src/main/java/io/greptime/models/ArrowHelper.java |
Rejects JSON2 bulk writes. |
ingester-protocol/pom.xml |
Upgrades the protobuf dependency. |
ingester-integration-tests/src/test/java/io/greptime/RegularWriteIT.java |
Adds JSON2 integration coverage. |
ingester-example/src/main/java/io/greptime/quickstart/write/Json2WriteQuickStart.java |
Adds a JSON2 quickstart example. |
.github/workflows/build.yml |
Updates GreptimeDB CI configuration. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Adds JSON2 ingestion through
DataType.Json2, matching the Rust client’s native Protobuf encoding and schema metadata. JSON objects (including nested arrays and scalars) are accepted, top-level JSON null becomes SQL NULL, and invalid input is rejected before sending. The schema metadata supports automatic JSON2 table creation even when the first write contains only NULL.greptimedb-prototo 0.16.0 and the CI integration server to GreptimeDB 1.2.1, including its renamed gRPC bind flag.Json2WriteQuickStartexample usingappend_mode=true, plus encoding and JDBC round-trip coverage.Validation:
-DargLine=--add-opens=java.base/java.nio=ALL-UNNAMEDfor Arrow.TableSchemaTestandJson2Testpassed after the final schema validation change.git diff --checkpassed.