Skip to content

feat: projeciton not work#10

Merged
fengys1996 merged 7 commits into
feat/nested-projection-support-epicfrom
fix/projection-not-work
Apr 8, 2026
Merged

feat: projeciton not work#10
fengys1996 merged 7 commits into
feat/nested-projection-support-epicfrom
fix/projection-not-work

Conversation

@fengys1996

Copy link
Copy Markdown
Owner

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

PLEASE DO NOT LEAVE THIS EMPTY !!!

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Summarize your change (mandatory)
  • How does this PR work? Need a brief introduction for the changed logic (optional)
  • Describe clearly one logical change and avoid lazy messages (optional)
  • Describe any limitations of the current code (optional)

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

Comment thread src/mito2/src/read/scan_region.rs Outdated
Comment thread src/mito2/src/read/scan_region.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

let read_cols =
build_read_columns(metadata, &projection_input.nested_paths, &read_column_ids)?;

P1 Badge Include predicate paths when pruning nested read columns

read_column_ids can contain extra columns required by pushed-down filters (from ScanRegion::build_read_column_ids), but this call builds ReadColumns using only projection_input.nested_paths. When a query projects one subfield (e.g. j.a) and filters on another subfield under the same root column (e.g. j.b), the reader will prune to only j.a, and later filter evaluation runs on incomplete data, which can drop matching rows or produce incorrect results. We need to merge filter-required nested paths (or disable nested pruning for predicate-referenced roots) before constructing ReadColumns.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@fengys1996 fengys1996 changed the title feat: proejciton not work feat: projeciton not work Apr 8, 2026
@fengys1996

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

build_read_columns(metadata, &projection_input.nested_paths, &read_column_ids)?;

P1 Badge Merge predicate subfields into nested read paths

Building read columns from projection_input.nested_paths here can prune away nested fields that are only referenced by filters: scan_region::build_read_column_ids adds predicate-required root columns, but it does not add predicate subpaths, so a query like SELECT j.a ... WHERE j.b = ... can read only j.a and evaluate the predicate on incomplete data, yielding incorrect results. Either merge predicate nested paths before build_read_columns or disable nested pruning for predicate-referenced roots.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread src/mito2/src/read/flat_projection.rs
Comment thread src/mito2/src/read/flat_projection.rs
@fengys1996
fengys1996 merged commit 8a6a1cb into feat/nested-projection-support-epic Apr 8, 2026
22 checks passed
@fengys1996
fengys1996 deleted the fix/projection-not-work branch April 8, 2026 09:13
fengys1996 added a commit that referenced this pull request Apr 13, 2026
* fix: projeciton not work and other questions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant