Skip to content

feat: datastream external table - streaming gRPC data load bridge (ENGINE = DATASTREAM) - #27469

Merged
fengttt merged 20 commits into
matrixorigin:mainfrom
fengttt:feat-datastream-external-table
Aug 22, 2026
Merged

fengttt merged 20 commits into
matrixorigin:mainfrom
fengttt:feat-datastream-external-table

Conversation

@fengttt

@fengttt fengttt commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #27468

What this PR does / why we need it:

Implements the datastream external table — a generic streaming data-load
bridge (CREATE EXTERNAL TABLE ... ENGINE = DATASTREAM) that reads
CSV-encoded chunks from a gRPC server, with a Java reference server
bridging the Java ecosystem (first candidate per the issue). Design spec:
docs/cn/stream_transport_fast_upload.md; implementation plan and as-built
notes: docs/cn/stream_transport_fast_upload_plan.md.

CREATE EXTERNAL TABLE t (col1 int, col2 timestamp, col3 varchar(100), col4 text)
ENGINE = DATASTREAM WITH (
    'server' = 'grpc_server_ip', 'port' = '4444',
    'table' = 'the_table_to_read_from', 'recheck' = 'true');
SELECT * FROM t WHERE col2 > '2020-11-11 00:00:00';

MO side (mirrors the ENGINE = MONGODB seams throughout):

  • Parser: datastream_table_param grammar + tree.DataStreamTableParam;
    datastream stays a non-reserved keyword.
  • DDL: new pkg/sql/datastream package validates options
    (server/port/table/recheck) and stores a planner-owned
    /* MO_DATASTREAM: ... */ envelope in rel_createsql, guarded by a
    durable features.DataStreamExternal bit (envelope and bit must agree).
    SHOW CREATE TABLE round-trips.
  • Plan: ExternType_DATASTREAM_TB + plan.DataStreamScan carried on
    ExternScan; remote-run wired through pipeline.ExternalScan.
  • Predicate pushdown: a conservative plan.Expr → MySQL-text deparser
    (comparisons, AND/OR/NOT, IN, BETWEEN, IS [NOT] NULL, LIKE over columns
    and literals). The pushed text is a hint; with recheck='true' (default)
    MO re-applies every filter locally. recheck='false' skips local
    re-evaluation for exactly the conjuncts that were pushed, so
    non-deparsable conjuncts always stay local and results can never be
    wrong-by-omission.
  • Execution reuses the CSV external scan operator wholesale: a new
    DataStreamReader (an ExternalFileReader) wraps the gRPC chunk stream
    as an io.Reader feeding the existing CSV parser and batch builder,
    using the INLINE virtual-single-file convention.

Wire contract: proto/datastream/v1/datastream.proto (plain proto3,
shared between the Go client and the Java server). Server-streaming Read;
chunks carry only complete CSV records; errors surface both as gRPC status
and as a terminal Error frame (TABLE_NOT_FOUND / DATASOURCE_ERROR).

Java reference server xtool/jstfu (Maven, shaded jar via make jstfu,
Java 8 bytecode so it runs on the CI/tester JDK 8; Maven wrapper included so
runners without Maven can build):

  • jdbc datasource: runs configured SQL with ${FILTER} replaced by the
    pushed predicate text (1=1 when absent), streams rows as CSV.
  • file datasource: streams an existing CSV re-chunked at record
    boundaries (quote-state aware, so quoted embedded newlines never split);
    filter hint is a documented noop.

Tests

  • Go unit: deparser table tests, envelope/options, DataStreamReader against
    an in-process fake gRPC server (multi-chunk, error frames, cancellation,
    record-spanning-chunk tolerance).
  • Java unit: chunker record-boundary invariant, ${FILTER} substitution,
    config validation.
  • test/datastream: self-contained e2e (starts the jar itself) including a
    full MatrixOne round-trip: file + jdbc scans, pushdown with recheck
    on/off, error propagation, ETL insert, parallel load with disjoint
    filters, and a 2KB-chunk multi-chunk streaming test that asserts every
    chunk boundary is record-aligned.
  • BVT test/distributed/cases/datastream: DDL validation, file + jdbc
    scans, NULL handling on a 20-column fixture with quoted embedded newlines
    (byte-identical vs LOAD DATA), AND/OR/IN/BETWEEN/NOT/LIKE pushdown with
    recheck=true/false equivalence, bulk ETL, and error conditions
    (table-not-found, bad file, jdbc SQL error, connection refused).

CI wiring

  • Standalone/launch BVT: optools/run_bvt.sh builds the jar (Maven
    wrapper) if needed and starts jstfu on 127.0.0.1:4444 before BVT;
    idempotent across the restart pass.
  • Compose BVT: jstfu-build service (maven image) builds the jar into a
    shared volume; jstfu-cn0/jstfu-cn1 sidecars share each CN's network
    namespace so 127.0.0.1:4444 resolves on whichever CN compiles the scan,
    and the jdbc datasources loop back to the CN's own 127.0.0.1:6001.
    Resources are mounted at /jstfu-test so the CI :/test mount rewrite
    cannot break the server's file paths. docker compose up -d blocks until
    the jar build completes, so BVT cannot start before jstfu is servable.

🤖 Generated with Claude Code

fengttt and others added 6 commits August 21, 2026 12:28
CREATE EXTERNAL TABLE ... ENGINE = DATASTREAM WITH ('server','port','table','recheck')
streams CSV chunks from a gRPC server (proto/datastream/v1) through the
existing external scan operator via a new DataStreamReader; predicate
conjuncts are conservatively deparsed to SQL text and pushed as a hint,
recheck=false skips local re-evaluation for exactly the pushed conjuncts.

Co-Authored-By: Claude Fable 5 <[email protected]>
- xtool/jstfu: Java gRPC reference server (Maven, shaded jar) with jdbc
  (${FILTER} substitution, streaming fetch) and file (record-aligned ~1MB
  chunking) datasources; make jstfu builds it
- test/datastream: self-contained e2e harness (starts the jar itself) incl.
  a full MO round-trip test with pushdown, recheck, errors, ETL, parallel load
- BVT cases + fixtures + optools/jstfu_bvt.sh launcher (40/40 pass)
- plan doc updated with as-built notes

Co-Authored-By: Claude Fable 5 <[email protected]>
- datastream_load.sql: load 10000-row and 1751-record (quoted embedded
  newlines) CSVs through jstfu file sources and verify byte-identical
  results vs LOAD DATA incl. NULL columns; observable hint semantics via
  file-source recheck=false; jdbc AND/OR/IN/BETWEEN/NOT/LIKE/IS NULL
  conditions with recheck=true and recheck=false returning identical
  results; mixed pushable+non-pushable conjunct; filtered ETL partitions
  reassembling the full table
- optools/jstfu_bvt.sh: file_parallel/file_rawlog/jdbc_parallel/jdbc_rawlog
  datasources

Co-Authored-By: Claude Fable 5 <[email protected]>
- jstfu BVT config now uses chunksize 4096 (default is 1MB), so the 1.9MB
  and 413KB fixtures stream as ~480/~100 chunks through the whole BVT;
  results verified unchanged (108/108)
- e2e TestJstfuMultiChunkStreaming: ~1MB generated file at 2KB chunks -
  hundreds of chunks, every boundary record-aligned (quote-state checked
  across embedded newlines), lossless reassembly
- Go reader tests: 500-chunk stream; record-spanning chunks tolerated
  (reader treats the stream as plain bytes)

Co-Authored-By: Claude Fable 5 <[email protected]>
The tester docker image (matrixorigin/tester:go1.26.4-jdk8) ships only
JDK 8 and no Maven, so the jar must be Java-8-runnable: release 17 -> 8,
replace arrow-switch / pattern-instanceof / text blocks / Java 11+ APIs.
All deps (grpc 1.68, protobuf 3.25, jackson 2.17, mysql-connector-j 8.4)
already ship Java 8 bytecode.  Verified: class-file major version 52,
jar smoke-tested under the actual tester image's JDK 8 (multi-chunk
stream, content byte-identical), mvn tests 10/10, e2e and BVT 108/108
re-run green with the rebuilt jar.

Co-Authored-By: Claude Fable 5 <[email protected]>
- optools/run_bvt.sh (standalone/launch): build jstfu.jar via the new Maven
  wrapper if missing and start it on :4444 before BVT; idempotent across
  the restart pass
- etc/launch-tae-compose: jstfu-build service (maven image, shared jar
  volume) plus jstfu-cn0/jstfu-cn1 sidecars sharing each CN's network
  namespace so the BVT's 127.0.0.1:4444 resolves on whichever CN compiles
  the scan; jdbc datasources loop back to the CN's own 127.0.0.1:6001;
  resources mounted at /jstfu-test because compose CI rewrites ':/test'
  mounts to host workspace paths
- xtool/jstfu: Maven wrapper (script-only) so runners with only JDK 8 and
  no Maven can build; pom compiles with source/target 1.8 on JDK 8 and
  --release 8 on JDK 9+ (javac 8 has no release flag); verified inside
  matrixorigin/tester:go1.26.4-jdk8

Co-Authored-By: Claude Fable 5 <[email protected]>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Co-Authored-By: Claude Fable 5 <[email protected]>

# Conflicts:
#	pkg/pb/plan/plan.pb.go
The bare 'main' pattern in .gitignore (for a built binary) also matched
Maven's src/main directory, so the seven jstfu implementation files were
silently excluded from every commit - only the tests were tracked.  A CI
clone would have built a source-less jar and crash-looped the sidecars.
Re-include xtool/jstfu/src/main/ and add the sources.

Co-Authored-By: Claude Fable 5 <[email protected]>

@aptend aptend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep review of exact head 7ed04d196a2cee2cbd83c8c248fa74004168df86, covering the complete 64-file diff, the author self-review, MO plan/compile/remote-run/operator lifecycle, the wire contract, Java service/JDBC/CSV paths, and both launch modes. I found blocking correctness, security, bounded-streaming, and CI-closure issues.

Validation: focused CGO Go packages passed (pkg/datastream/v1, datastream config/filter, external, compile, plan, MySQL parser, features); new-path race tests passed with -race -count=20; Java tests passed under JDK 25 targeting release 8. A temporary binary counterexample reproduced corruption: input bytes ff 00 80 emerged as 5 UTF-8 bytes instead of 3; the temporary test was removed. The exact head also does not contain the launch script invoked by run_bvt.sh.

Comment thread pkg/sql/compile/compile.go Resolved
Comment thread optools/run_bvt.sh Resolved

@iamlinjunhong iamlinjunhong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the exact head 7ed04d196a2cee2cbd83c8c248fa74004168df86 against current main (5a1ddf0e80ae9197f2b3bc603aa5ca4930a136b1), including the complete 64-file diff, DDL/catalog/plan/compile/remote-run/external-reader call chain, protobuf contract, Java JDBC/file service, both launch paths, and tests. I am requesting changes because the following P1 blockers remain.

  • P1 correctness — pkg/sql/compile/compile.go:2543: default recheck=true still sends every deparsed predicate to the source before local re-evaluation. Local recheck can discard over-returned rows but cannot restore rows already removed under different source semantics. For example, if the source collation treats a and A as equal while MO distinguishes them, s <> 'a' drops both at the source and MO never sees the A row. The default mode therefore produces wrong results unless pushdown is proven superset-preserving or semantic alignment is enforced.

  • P1 security — pkg/sql/datastream/filter.go:276 and xtool/jstfu/src/main/java/io/matrixone/jstfu/source/JdbcSource.java:48: MO escapes apostrophes as \', then jstfu substitutes the resulting text directly into configured SQL. A source session using the valid MySQL mode NO_BACKSLASH_ESCAPES treats that apostrophe as a terminator, so an ordinary MO predicate containing a crafted string literal can append UNION SELECT ... and execute it with jstfu's configured JDBC credentials. This remains exploitable even if the RPC endpoint itself is trusted; the filter needs a structured/parameterized representation or source-independent validation, with a differing-SQL-mode negative test.

  • P1 security — xtool/jstfu/src/main/java/io/matrixone/jstfu/Main.java:58, DataStreamService.java:44-52, and JdbcSource.java:48: the reference server binds on all interfaces with plaintext gRPC and performs no authentication/authorization. Any network client can select a configured datasource and supply arbitrary filter text, bypassing MO's deparser entirely and injecting it into ${FILTER}. A README trust warning is not an enforcement boundary for the JDBC credentials and data exposed by the service.

  • P1 lifecycle/performance — xtool/jstfu/src/main/java/io/matrixone/jstfu/DataStreamService.java:59-66 and JdbcSource.java:54-74: the producer calls onNext without readiness-based flow control, so a fast/large result queues unbounded output when the MO consumer is slow and can OOM jstfu. Cancellation is checked only while emitting a chunk; cancellation during blocked getConnection, executeQuery, or rs.next() does not cancel/close the active JDBC statement and leaves the RPC executor and database resources stuck. Please make sends readiness-driven and wire onCancel to active JDBC cancellation/close, with slow-consumer and blocked-read tests.

  • P1 data correctness — xtool/jstfu/src/main/java/io/matrixone/jstfu/source/JdbcSource.java:86-90 and CsvChunker.java:47: byte[] is converted through ISO-8859-1 characters and then encoded as UTF-8. The concrete input bytes ff 00 80 become c3 bf 00 c2 80 (3 bytes to 5), while MO appends CSV field bytes directly for BINARY/VARBINARY/BLOB. Non-ASCII binary values are therefore silently corrupted. Preserve raw bytes or define a reversible wire encoding and test a binary round trip.

  • P1 CI closure — optools/run_bvt.sh:61: the invoked optools/jstfu_bvt.sh is absent from this exact head (git ls-tree returns no entry), consistent with the repository-wide *.sh ignore rule. With no existing listener, every standalone launch waits 30 seconds and exits before BVT. The relevant launch checks were skipped in the current run, so the green checks do not exercise this path. Add/track the script and smoke-test the exact command.

Non-blocking findings:

  • P2 compatibility — pkg/sql/colexec/external/reader_datastream.go:72: concatenating server + ":" + port produces an invalid target for a normal IPv6 literal such as ::1 (::1:4444). Use net.JoinHostPort (and define whether bracketed input is accepted) with an IPv6 reader test.
  • P2 build/test reliability — Makefile:373-378: make jstfu exits successfully without producing the promised jar when Maven is absent, even though the repository includes mvnw; the e2e then skips on the missing jar. Use the wrapper/fail the target so a successful build cannot silently omit all Java/product-path validation.

Validation notes: all 31 GitHub checks are complete with no failed or pending check; Java unit tests pass 10/10 on this head targeting release 8. I independently reproduced the binary charset counterexample above. The isolated host lacks the repository's native jemalloc/libmo prerequisites, so focused CGo-transitive Go tests stop at the environment header check rather than producing a code result; I did not treat that as either a pass or a PR failure.

…ing, tracked script)

MO side:
- recheck=true (default) no longer pushes any filter: a pushed predicate is
  not provably superset-preserving across engines, so the server could drop a
  row MO wants under different collation/tz and local recheck (which only
  removes over-returned rows) cannot restore it. The safe default now returns
  the full source and filters locally; recheck=false remains the opt-in that
  trusts server semantics for the pushed conjuncts. (aptend P1)

jstfu server:
- consumer flow control + cancellation: the source drains on a worker thread
  bounded by ServerCallStreamObserver.isReady() (slow MO consumer no longer
  OOMs jstfu), and onCancel closes the source's registered JDBC connection /
  file stream and interrupts the worker so a cancelled MO query releases a
  blocked JDBC read instead of leaking it. (aptend P1)
- binary columns: reject BINARY/VARBINARY/BLOB with a clear error instead of
  the ISO-8859-1->UTF-8 dance that silently corrupted bytes >= 0x80. (aptend P1)
- bind to 127.0.0.1 by default (configurable host) so the unauthenticated
  ${FILTER}-into-SQL surface is not exposed off-box out of the box. (aptend P1)

Tooling:
- track optools/jstfu_bvt.sh (the *.sh ignore rule hid it, so the launch-BVT
  path run_bvt.sh invokes would fail on a clean checkout). (aptend P1)

Validated: jstfu 13 unit tests, datastream BVT 108/108 and e2e green against a
rebuilt server, deparser/compile unit tests green.

Co-Authored-By: Claude Fable 5 <[email protected]>
Closes the remaining open review thread (unauthenticated -into-SQL
surface). A shared-secret API key authenticates MO->jstfu requests:

- proto: ReadRequest.api_key + ErrorCode.ERROR_UNAUTHENTICATED (Go+Java regen)
- jstfu: optional server 'apikey' config; when set, every Read must present a
  matching key (constant-time MessageDigest.isEqual) or gets an
  ERROR_UNAUTHENTICATED frame; empty disables the check (backward compatible)
- MO: new 'apikey' WITH-option -> Config.APIKey -> url-escaped in the
  rel_createsql envelope -> plan.DataStreamScan.api_key -> ReadRequest; the
  reader surfaces auth failures with a clear 'check the apikey option' message
- the key is NEVER shown by SHOW CREATE (would leak the secret; a restored
  table must re-supply it) and is redacted in parser Format output

Tests: Go reader (correct/wrong key), config option + envelope round-trip incl.
a key with envelope-breaking bytes and a legacy no-apikey envelope; Java
DataStreamService auth gate (disabled/wrong/missing/correct); e2e full
handshake through MO (accept/reject/no-leak); BVT option-parse + SHOW-CREATE
no-leak. datastream BVT 111/111, e2e green, jstfu 17 unit tests.

Co-Authored-By: Claude Fable 5 <[email protected]>
…mvnw build

Addresses iamlinjunhong review (the P1s it raised on the older head were
already fixed by 4f39a97/6c53e43; these are the genuinely new items):

- P1 injection under NO_BACKSLASH_ESCAPES: the deparser backslash-escaped
  apostrophes ('\''), which a source session in NO_BACKSLASH_ESCAPES treats
  as a string terminator, letting a crafted predicate value break out into
  SQL run with jstfu's credentials. Now quote with ''-doubling only (mode
  independent) and refuse to push any string literal containing a backslash
  (no portable single-quoted form). Added a differing-sql_mode e2e negative
  test (jdbc source forced to NO_BACKSLASH_ESCAPES) plus deparser unit tests
  for the doubled/injection/refused cases.
- P2 IPv6: dial target built with net.JoinHostPort (::1 -> [::1]:4444) in the
  reader and Config.Address(), not 'server:port' concatenation; IPv6 unit test.
- P2 make jstfu: default to the committed ./mvnw wrapper and fail on error, so
  a missing system mvn can no longer silently skip the jar build.

datastream BVT 111/111 (unchanged), e2e green incl. the NBS regression,
unit + reader tests green.

Co-Authored-By: Claude Fable 5 <[email protected]>
@fengttt

fengttt commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@iamlinjunhong thanks for the thorough pass. Your review was against head 7ed04d196a; most of the P1s were already fixed in commits pushed after that head (4f39a97, 6c53e43), and the genuinely-new items are fixed in b888a5c. Point by point:

P1 injection under NO_BACKSLASH_ESCAPES (filter.go / JdbcSource ${FILTER}) — new, fixed in b888a5c. The deparser no longer backslash-escapes: string literals are quoted with ''-doubling only (sql_mode-independent), and any literal containing a backslash is not pushed (a backslash has no portable single-quoted form). So a crafted value stays inside the literal on a NO_BACKSLASH_ESCAPES source instead of breaking out. Added the differing-sql_mode negative test you asked for: TestDatastreamNoBackslashEscapesSource forces the jdbc session to NO_BACKSLASH_ESCAPES, uses recheck=false (server-authoritative), and asserts an apostrophe predicate returns the correct row; plus deparser unit tests for the doubled / injection-neutralized / backslash-refused cases.

P1 correctness recheck=true (compile.go:2543) — fixed in 4f39a97. recheck=true (default) now pushes nothing; the server returns the full source and MO filters locally, so it is correct under any collation/tz/coercion. Only recheck=false (opt-in) pushes.

P1 security — bind-all + no auth (Main / DataStreamService) — fixed in 4f39a97 (bind 127.0.0.1 by default) and 6c53e43 (optional API key: server apikey, constant-time checked; MO supplies it via the 'apikey' WITH-option, never shown by SHOW CREATE). An off-box client now needs the shared secret, not just reach.

P1 flow control + cancel (DataStreamService / JdbcSource) — fixed in 4f39a97. The source drains on a worker thread bounded by ServerCallStreamObserver.isReady(); onCancel closes the registered JDBC connection / file stream and interrupts the worker, so a cancel during a blocked getConnection/executeQuery/next releases it. Cancel-stops-streaming unit test added.

P1 binary corruption (JdbcSource / CsvChunker) — fixed in 4f39a97. byte[] values are rejected with a clear SQLDataException (project as HEX(col)) instead of the ISO-8859-1→UTF-8 corruption; unit test asserts {0xff,0x00,0x80} throws.

P1 CI closure — optools/jstfu_bvt.sh missing (*.sh ignore) — fixed in 4f39a97: force-added with a !optools/jstfu_bvt.sh ignore exception; re-audited all new dirs for other hidden files.

P2 IPv6 target (reader_datastream.go:72) — fixed in b888a5c: dial target built with net.JoinHostPort (::1 → [::1]:4444) in the reader and Config.Address(); IPv6 unit test added.

P2 make jstfu silent skip (Makefile) — fixed in b888a5c: the target now defaults to the committed ./mvnw wrapper (bootstraps its own Maven) and fails on error, so a missing system mvn can no longer silently omit the jar.

Validation on the current head: datastream BVT 111/111, e2e green (incl. the NBS regression, API-key handshake, multi-chunk), jstfu 17 unit tests, deparser/reader/compile unit tests green. All 5 inline review threads are resolved.

Co-Authored-By: Claude Fable 5 <[email protected]>
Add a full Configuration file reference to the jstfu README: top-level
field table (host/port/apikey/chunksize/datasource) and datasource field
table (jdbc/file), plus a 'Setting the listen address and API key' section
with a worked bind-all + apikey example and the matching MO DDL. Trim the
Security section to cross-reference it.

Co-Authored-By: Claude Fable 5 <[email protected]>

@aptend aptend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed exact head 7d5c26561ce8fc0f98e4679a7a377135ba404461 against the prior reviewed head 7ed04d196a2cee2cbd83c8c248fa74004168df86. I read all historical reviews, replies, and resolved threads, checked the incremental commits plus the complete PR diff, and independently verified the earlier fixes for recheck semantics, sql_mode-safe literals, IPv6 targets, binary rejection, the tracked BVT script, and Maven invocation. Two blocking unhappy-path/security issues remain: cancellation can lose both worker and resource publication races, and the shared API key is persisted/logged in plaintext. Both were reproduced with temporary deterministic counterexample tests, which were removed after validation. Relevant Java tests, Go package tests, focused race tests, and go vet passed.

Comment thread pkg/sql/datastream/config.go Resolved
fengttt and others added 2 commits August 21, 2026 23:33
Co-Authored-By: Claude Fable 5 <[email protected]>
Addresses the two new P1 review comments (aptend):

jstfu concurrency (DataStreamService):
- cancellation, worker publication, and resource registration are now atomic
  via a synchronized Cancellation guard: cancel closes everything registered
  so far, registering after cancel closes the resource immediately and tells
  the source to stop, and the worker future is re-checked after submit so a
  cancel that raced submission still interrupts it
- jdbc statement query timeout (querytimeoutseconds) bounds a stalled
  executeQuery/next even without a client cancel; connection close on cancel
  remains the unblock path
- worker pool bounded (maxconcurrentreads, default 256) with a busy error on
  overflow, replacing the unbounded cached pool
- unit tests for cancel-closes-registered and register-after-cancel-closes

api key secret handling:
- MO 'apikey' value may be an 'env:NAME' reference; the catalog/plan/logs then
  hold only the reference and the CN resolves the secret from its environment
  at scan time (ResolveAPIKey), keeping the secret out of queryable
  rel_createsql. Literal keys still work (documented as catalog-visible).
- datastream CREATE is now redacted in statement logging
  (redactStatementTextForLogging), so the apikey never reaches statement_info
- tests: ResolveAPIKey unit, frontend redaction unit, e2e env-ref (CN resolves
  from env, catalog stores only the reference, secret absent)

Validated: jstfu 19 unit tests, datastream BVT 111/111, e2e green incl.
env-ref, Go unit/reader/frontend tests green.

Co-Authored-By: Claude Fable 5 <[email protected]>

This branch was previously deployed

1 inactive deployment
ci — db0d2938 Deployed Aug 22, 2026 by fengttt via Matrixone Utils CI / Coverage #47601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants