com um clique
code-review
Review code with Doris-specific checklists
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Review code with Doris-specific checklists
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Fix BE (C++) code formatting issues using clang-format
Run clang-tidy on newly added/modified BE C++ code
Fix FE (Java) code style issues using Checkstyle
Run Doris docker-based regression tests from a clean package
| name | code-review |
| description | Review code with Doris-specific checklists |
| compatibility | opencode |
Complete code review work to ensure code quality. Due to the length of content, you can read sections as needed based on the actual modifications being reviewed.
Use this when you need to review code, whether it is code you just completed or directly reviewing target code.
NO_NEW_VALUABLE_FINDINGS for the same current ledger/comment set after the last candidate update.AGENTS.md in the corresponding source directory listed in Part 2. Those files contain non-obvious conventions and traps specific to each subsystem.Always focus on the following core invariants during review:
TEMP_VERSION-style placeholders must be replaced with actual versions before useMemTracker; orphan memory is not allowedStatus; silent continuation is never allowedWhen reviewing optimizer rules, plan rewrites, expression rewrites, slot/ExprId handling, predicate movement, join rewrites, TopN/sort/project rewrites, materialization, or other Nereids planner behavior, findings should be explained around a concrete plan tree whenever possible.
Prefer this structure for each optimizer finding:
collectFromNode, simplifyProject, addUpperProject, replace, infer, or pushDown.Avoid long prose-only descriptions when a plan tree can make the issue concrete. For example, instead of only writing that "a replacement map bypasses canPullUp for aliases that were intentionally rejected", write:
TopN(order by id)
Project(id, assert_true(x > 0) AS c)
Project(id, a + 1 AS x)
Scan(id, a)
Then explain that c is not pullable because it contains NoneMovableFunction, but x is pullable. If collectFromNode records both c -> assert_true(x > 0) and x -> a + 1, simplifyProject can remove x below TopN and addUpperProject can synthesize assert_true(a + 1 > 0) AS c above TopN. That moves a non-movable expression above TopN and may suppress errors for rows discarded by TopN. The fix direction is to let non-forwarding aliases that cannot be synthesized above TopN block their input slots, while keeping simple forwarding aliases available for chain resolution.
The plan tree does not need to be fully executable SQL, but it must preserve the relevant output slots and operator dependencies. If the exact tree is unknown, state that it is a reduced tree inferred from the code path.
For PRs with not only local minor modifications, before answering specific questions, you must read and deeply understand the complete process involved in the code modification, thoroughly comprehend the role, function, and expected functionality of the reviewed functions and modules, the actual triggering methods, potential concurrency, and lifecycle. It is necessary to understand the specific triggering methods and runtime interaction relationships, as well as dependencies, of the specific code in a concrete visual manner.
The following checkpoints must be individually confirmed with conclusions during review. If the code is too long or too complex, you should delve into the code again as needed when analyzing specific issues, especially the entire logic chain where there are doubts:
After checking all the above items with code. Use the remaining parts of this skill as needed. The following content does not need individual responses; just check during the review process.
If it involves the judgment of concurrent scenarios, it is necessary to find the starting point of concurrency and actually understand all actually possible concurrent situations (which thread initiated what at what stage, and what concurrent operations there will be). Due to the clear program semantics, some functions of the same module are executed in stages, so concurrency is definitely not present, there should be no misjudgment.
be/src/runtime/AGENTS.md)relaxed for counters only; at least acquire/release for signals and lifecycle flagsStatus must be checked; silent discard is prohibitedTHROW_IF_ERROR? (See be/src/common/AGENTS.md)DORIS_CHECK for invariants only, never speculative defensive checkstry_reserve() before large allocations, with guaranteed release on every exit pathbe/src/core/custom_allocator.h such as DorisVector, DorisMap, and DorisUniqueBufferPtr instead of std::vector, std::map, and std::unique_ptrbe/src/runtime/AGENTS.md for cache-handle, shared_ptr-cycle, and factory-creator rulesbe/src/storage/AGENTS.md for delete-bitmap sentinel replacement, MoW enablement, and serialization rulesfe/.../persist/AGENTS.md)is_column_nullable() and check_and_get_column<ColumnNullable> can an IColumn be safely converted to ColumnNullable without checking. If is_nullable() is used to check and then the corresponding column is treated as ColumnNullable, is there a clear comment explaining why it cannot be a ColumnConst?is_null_at() called only for objects that have been syntactically parsed as ColumnNullable?ColumnConst(ColumnNullable(...)) can reach this code, is it handled explicitly or materialized once at a documented boundary with convert_to_full_column_if_const() before row-by-row logic?ColumnConst(ColumnNullable(...)) cannot reach this code, is the upstream/downstream materialization invariant identified, asserted with DORIS_CHECK/DCHECK where appropriate, and documented on both sides of the dependency?remove_nullable(column) call account for its const-preserving behavior? ColumnNullable(T) becomes T, while ColumnConst(ColumnNullable(T)) becomes ColumnConst(T); if downstream needs row-aligned concrete storage, materialize intentionally after removing nullable.if branches for impossible shapes, and invariant violations fail loudly instead of silently continuing?.out files must be auto-generated, never handwrittenorder_qt_ or explicit ORDER BY for deterministic outputtest { sql "..."; exception "..." }def tableNameDetailed module review guides live in AGENTS.md files in each source directory. Read the relevant file when reviewing module-specific code.
| Directory | Coverage |
|---|---|
be/src/common/AGENTS.md | Error handling and compile_check |
be/src/cloud/AGENTS.md | Cloud RPC and CloudTablet sync rules |
be/src/runtime/AGENTS.md | MemTracker, cache lifecycle, SIOF, workload-group memory tracking |
be/src/core/AGENTS.md | COW columns, type metadata, serialization compatibility |
be/src/exec/AGENTS.md | Pipeline execution, dependency concurrency, spill and memory pressure |
be/src/storage/AGENTS.md | Tablet locks, rowset lifecycle, MoW delete bitmap, segment writing |
be/src/storage/index/inverted/AGENTS.md | Inverted-index lifetime, CLucene boundary, three-valued bitmap |
be/src/storage/schema_change/AGENTS.md | Schema-change strategy, lock order, MoW catch-up flow |
be/src/io/AGENTS.md | Filesystem async path and remote reader caching |
| Directory | Coverage |
|---|---|
fe/fe-core/AGENTS.md | FE locking, exception model, visible-version semantics |
fe/fe-core/src/main/java/org/apache/doris/persist/AGENTS.md | EditLog write/replay path and transaction persistence modes |
fe/fe-core/src/main/java/org/apache/doris/nereids/AGENTS.md | Rule placement, mark-join constraints, property derivation |
fe/fe-core/src/main/java/org/apache/doris/transaction/AGENTS.md | Transaction lifecycle, publish semantics, cloud manager usage |
fe/fe-core/src/main/java/org/apache/doris/datasource/AGENTS.md | External catalog initialization and reset hazards |
fe/fe-core/src/main/java/org/apache/doris/backup/AGENTS.md | Backup/restore log timing and replay ordering |
| Directory | Coverage |
|---|---|
cloud/src/meta-store/AGENTS.md | TxnKv, key encoding, versioned values, versionstamp helpers |
cloud/src/meta-service/AGENTS.md | Cloud transaction commit paths, RPC retry contract, Cloud MoW contract |
cloud/src/recycler/AGENTS.md | Recycler safety, two-phase delete, packed-file ordering |
TPlanNodeType values have matching BE handling?order_qt_ or explicit ORDER BY used?test { sql ...; exception ... }?def tableName?.out files generated, not handwritten?TEST / TEST_F used appropriately, independent of execution order?These are cross-module patterns that cause silent or hard-to-diagnose failures. Module-specific traps are in the corresponding AGENTS.md files.
| Pattern | Risk | Why it's dangerous |
|---|---|---|
Ignored Status | Critical | Silent failure propagation; invariant violations go undetected |
THROW_IF_ERROR in Defer or destructors | Critical | Terminates during stack unwinding |
THROW_IF_ERROR without catch-and-convert boundary | High | Doris exception escapes its intended scope |
| Cross-TU static initializer dependency | High | Initialization order undefined; crashes or wrong values at startup |
use_default_implementation_for_nulls() is disabled, is the null map fully handled manually?need_replace_null_data_to_default() set correctly for garbage-payload null positions?ColumnConst(ColumnNullable(...)) handled when default null handling is disabled?IFunction subclasses carry no member state?_foreach placed correctly in registration?ColumnString offset maintenance exact (off-by-one corrupts later rows silently)?config::xxx has comments, defaults, and standard naming?std::mutex on bthread paths?bthread_usleep used instead of thread-level sleep in coroutine code?Item-by-item responses are required only for Part 1.3. Parts 2–7 are supporting material for finding bugs, stale assumptions, and missing coverage.