Skip to content

enh(stream): fix trim block error#33299

Merged
dapan1121 merged 11 commits intomainfrom
marks/block-trim
Oct 21, 2025
Merged

enh(stream): fix trim block error#33299
dapan1121 merged 11 commits intomainfrom
marks/block-trim

Conversation

@wangmm0220
Copy link
Copy Markdown
Contributor

Description

Please briefly describe the code changes in this pull request.

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @wangmm0220, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an error in the streaming module by introducing a specialized data block trimming function, trimDataBlock2. This new function is conditionally applied within the extractQualifiedTupleByFilterResult logic, ensuring that stream-generated data blocks are processed correctly. The changes also include minor adjustments to null handling for variable data types in stream processing, aiming to enhance the robustness and correctness of data manipulation within the streaming pipeline.

Highlights

  • New Data Block Trimming Function: Introduced trimDataBlock2 in tdatablock.c and its declaration in tdatablock.h to handle data block trimming, specifically designed for stream processing.
  • Conditional Data Trimming Logic: The extractQualifiedTupleByFilterResult function in the executor module was updated to use the new trimDataBlock2 function when processing data originating from streams, while retaining the original trimDataBlock for other cases.
  • Refined Null Handling for Variable Data Types: Removed unnecessary colDataClearNull_f calls for variable data types in vnodeStream.c to prevent potential issues or improve efficiency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new function, trimDataBlock2, as an optimized version of trimDataBlock for stream processing. This new function is invoked when filtering data blocks originating from a stream. While the implementation for fixed-size data types is functionally correct, I've identified a critical issue in the handling of variable-length data types that could lead to data corruption. Additionally, there's an opportunity to refactor duplicated code for fixed-size types to enhance maintainability. The other changes in the pull request correctly integrate this new function.

Comment thread source/common/src/tdatablock.c Outdated
Comment thread source/common/src/tdatablock.c Outdated
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

colDataSetNNULL(pColInfoData, currentRow, numOfRows);
} else {
for (uint32_t i = 0; i < numOfRows; i++){
for (uint32_t i = 0; i < numOfRows && !IS_VAR_DATA_TYPE(pColInfoData->info.type); i++){
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.

这个条件放循环外面不就可以了

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

get

@dapan1121 dapan1121 merged commit 21ffad4 into main Oct 21, 2025
7 of 11 checks passed
@minhuinie minhuinie deleted the marks/block-trim branch February 4, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants