Skip to content

GH-43594: [C++] Remove std::optional from arrow::ArrayStatistics::is_{min,max}_exact - #43595

Merged
kou merged 1 commit into
apache:mainfrom
kou:cpp-array-statistics-exact
Aug 16, 2024
Merged

kou merged 1 commit into
apache:mainfrom
kou:cpp-array-statistics-exact

Conversation

@kou

@kou kou commented Aug 7, 2024 •

Copy link
Copy Markdown
Member

Rationale for this change

We don't need "unknown" state. If they aren't set, we can process they are not exact.

What changes are included in this PR?

Remove std::optional from arrow::ArrayStatistics::is_{min,max}_exact.

Are these changes tested?

Yes.

Are there any user-facing changes?

Yes.

@github-actions

github-actions Bot commented Aug 7, 2024

Copy link
Copy Markdown

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

Comment thread cpp/src/arrow/array/statistics.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me, but IMO is_min_exact = false might still has exact statistics but the reader cannot gurantee that, since apache/parquet-format#216 is new in 2.10 :-(

@kou kou Aug 10, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Are the followings correct?

  1. Parquet 2.9 or earlier data don't have is_min_value_exact/is_max_value_exact
  2. Parquet 2.9 or earlier data use only exact min/max
  3. Parquet 2.10 or later data use exact min/max or non-exact min/max
  4. Parquet 2.10 or later data may use exact min/max without is_min_value_exact/is_max_value_exact

You're focusing on the 2. case, right? Can our Parquet reader detect Parquet version? If so, can we always set true to is_min_exact/is_max_exact for Parquet 2.9 or earlier?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for late replying

Parquet 2.9 or earlier data don't have is_min_value_exact/is_max_value_exact

Yes

Parquet 2.9 or earlier data use only exact min/max

I guess no, I'll send a mail to maillist to make it sure

Parquet 2.10 or later data use exact min/max or non-exact min/max

Yes

Parquet 2.10 or later data may use exact min/max without is_min_value_exact/is_max_value_exact

right

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If so, can we always set true to is_min_exact/is_max_exact for Parquet 2.9 or earlier?

Hmmm I'll try to make it clear

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks!

@mapleFU mapleFU Aug 16, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Anyway we can mention "exact=false" can also means is exact, lol

Or we can denote that the parquet-c++ output is exact.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK. Let's use exact=true for Apache Parquet C++ output.

…s::is_{min,max}_exact

We don't need "unknown" state. If they aren't set, we can process they
are not exact.
@kou
kou merged commit b80a51a into apache:main Aug 16, 2024
@kou
kou deleted the cpp-array-statistics-exact branch August 16, 2024 05:23
@conbench-apache-arrow

Copy link
Copy Markdown

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

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants