Skip to content

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

Merged
JingsongLi merged 2 commits intoapache:masterfrom
Aitozi:field-stats
Nov 28, 2024
Merged

[core] Avoid extract from file footer when stats mode is none#4604
JingsongLi merged 2 commits intoapache:masterfrom
Aitozi:field-stats

Conversation

@Aitozi
Copy link
Copy Markdown
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
Copy Markdown
Contributor

+1

public abstract class StatsCollectingSingleFileWriter<T, R> extends SingleFileWriter<T, R> {

@Nullable private final SimpleStatsExtractor simpleStatsExtractor;
@Nullable private SimpleStatsCollector simpleStatsCollector = null;
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.

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

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

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.

Fixed

Copy link
Copy Markdown
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
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