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

[core] Avoid extract from file footer when stats mode is none #4604

Merged
merged 2 commits into from
Nov 28, 2024

Conversation

Aitozi
Copy link
Contributor

@Aitozi Aitozi commented Nov 27, 2024

Purpose

This could save one remote IO operation when stats mode is none

Tests

API and Format

Documentation

@wwj6591812
Copy link
Contributor

+1

@@ -43,7 +43,7 @@
public abstract class StatsCollectingSingleFileWriter<T, R> extends SingleFileWriter<T, R> {

@Nullable private final SimpleStatsExtractor simpleStatsExtractor;
@Nullable private SimpleStatsCollector simpleStatsCollector = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you keep it nullable, and just create a field isStatsDisabled from

Arrays.stream(statsCollectors)
                        .allMatch(p -> p instanceof NoneSimpleColStatsCollector)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit fdcdd09 into apache:master Nov 28, 2024
11 of 12 checks passed
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.

3 participants