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-44579: [C++] Use array type to compute min/max statistics Arrow type #45094

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

kou
Copy link
Member

@kou kou commented Dec 21, 2024

Rationale for this change

arrow::ArrayStatistics uses raw C++ types such as int64_t and std::string for min/max types. We need to convert raw C++ types to Arrow types when we use arrow::ArrayStatistics for generating statistics array. (GH-45038)

We can't map std::string to an Arrow type. Because it may be arrow::binary(), arrow::utf8() or something.

What changes are included in this PR?

Use arrow::DataType information of associated array when we convert arrow::ArrayStatistics's min/max raw C++ types to Arrow types.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

Copy link

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

switch (array_type->id()) {
case Type::STRING:
case Type::BINARY:
case Type::FIXED_SIZE_BINARY:
Copy link
Member Author

Choose a reason for hiding this comment

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

Should we use arrow::binary() or arrow::large_binary() for Type::FIXED_SIZE_BINARY?
Approximate min/max values may not be a fixed size binary...?

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Dec 21, 2024
@kou
Copy link
Member Author

kou commented Dec 25, 2024

I'll merge this in the next week if nobody objects this.

@kou kou merged commit fd1bf8e into apache:main Dec 31, 2024
38 checks passed
@kou kou deleted the cpp-array-statistics-binary branch December 31, 2024 03:05
@kou kou removed the awaiting changes Awaiting changes label Dec 31, 2024
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.

1 participant