Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-34529: [C++][Compute] Replace explicit checking with DCHECK for invariants in row segmenter #44236

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

zanmato1984
Copy link
Collaborator

@zanmato1984 zanmato1984 commented Sep 26, 2024

Rationale for this change

As #34529 described.

What changes are included in this PR?

Change the if checking for invariants in row segmenter to DCHECK.

Are these changes tested?

No need.

Are there any user-facing changes?

None.

@github-actions github-actions bot added the awaiting review Awaiting review label Sep 26, 2024
Copy link

⚠️ GitHub issue #34529 has been automatically assigned in GitHub to PR creator.

@zanmato1984
Copy link
Collaborator Author

I found a remaining trivial enhancement request regarding to row segmenter, hence filing this trivial PR. @pitrou Mind to take a look? Thanks.

Copy link
Member

@mapleFU mapleFU left a comment

Choose a reason for hiding this comment

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

So they would not get error in these scenrio?

@@ -448,17 +431,6 @@ struct AnyKeysSegmenter : public BaseRowSegmenter {
group_id_t save_group_id_;
};

Status CheckAndCapLengthForConsume(int64_t batch_length, int64_t& consume_offset,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved down into the next anonymous namespace enclosing Grouper because this function is for Grouper to use.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Sep 26, 2024
@zanmato1984
Copy link
Collaborator Author

So they would not get error in these scenrio?

The errors touched in this PR are all internal invariants, that are not breakable by user inputs. In other words, these errors can only occur on bad implementation, so DCHECK should be sufficient.

As a comparison, some checking, e.g.

if (values.size() != key_types.size()) {
return Status::Invalid("expected batch size ", key_types.size(), " but got ",
values.size());
}

can be triggered by user's (invalid) input, so it is kept as is.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Sep 26, 2024
@pitrou pitrou merged commit ac6d7e8 into apache:main Oct 1, 2024
40 of 41 checks passed
@pitrou pitrou removed the awaiting merge Awaiting merge label Oct 1, 2024
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Oct 1, 2024
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit ac6d7e8.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 10 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants