Repository navigation
feat: add MongoDB external table scan - #26424
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Blocking correctness issue: the external-table DDL accepts NOT NULL, but ParseTableMappingSpec drops planned.Typ.NotNullable when it builds ColumnMapping (mapping.go:137-144), and the runtime converter unconditionally appends NULL for missing/BSON null/undefined values and for try_null conversion failures (converter.go:138-143, 153-164). I reproduced this end to end at the component boundary with CREATE EXTERNAL TABLE t (v BIGINT NOT NULL MONGODB_CONVERT "try_null") ...: mapping succeeds with the plan column marked NotNullable=true, then an empty BSON document produces a NULL in the output vector. This violates a planner-visible schema invariant and can make nullability-based rewrites/join reasoning unsound. Please either reject NOT NULL (and other unenforceable constraints) on MongoDB external columns, or carry nullability through catalog/plan metadata and make the converter fail rather than emit NULL for a non-nullable mapping. Add coverage for missing, explicit BSON null, and try_null conversion failure on a declared NOT NULL column.
fengttt
left a comment
There was a problem hiding this comment.
Wait, why does mongo db has anything to do with frontend?
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep re-reviewed exact head b7ec571875852b6d691a7543ef8dd9f422b88af8: no blocking findings. The previous NOT NULL correctness blocker is closed end to end: declared nullability is captured from the planned TableDef, persisted in catalog mapping JSON, preserved through protobuf plan conversion, and enforced by the runtime converter for missing paths, BSON null/undefined, invalid traversal, and try_null conversion failures. Error rollback restores every vector and the batch row count, so a rejected document cannot leave a partial row.
Fresh local evidence: converter/catalog NOT NULL tests pass under -race -count=10, the planner DDL round-trip test passes, and go build plus go vet pass for pkg/sql/mongodb, pkg/sql/colexec/mongoscan, and pkg/sql/plan. Final diff is clean, latest CI is green, and the PR remains MERGEABLE.
|
@iamlinjunhong conflict |
Add tenant-scoped MongoDB connection DDL and catalog metadata, secure driver-backed scanning, conversion and predicate semantics, downstream aggregation support, and complete ALTER/DROP/account lifecycle handling across CNs. Include one connector E2E CI job, regression coverage, and customer-neutral operational templates.
fixed |
Merge Queue Status
This pull request spent 37 minutes 12 seconds in the queue, including 36 minutes 54 seconds running CI. Required conditions to merge
|
Add tenant-scoped MongoDB connection DDL and catalog metadata, secure driver-backed scanning, conversion and predicate semantics, downstream aggregation support, and complete ALTER/DROP/account lifecycle handling across CNs. Include one connector E2E CI job, regression coverage, and customer-neutral operational templates.
What type of PR is this?
Which issue(s) this PR fixes:
issue #26229
What this PR does / why we need it:
feat: add MongoDB external table scan