Skip to content

GH-45534: [C++] Test: RunEndEncodeTableColumns should update REE columns' schema types - #45535

Merged
mapleFU merged 2 commits into
apache:mainfrom
lesterfan:fix-ree-util-bug
Apr 11, 2025
Merged

mapleFU merged 2 commits into
apache:mainfrom
lesterfan:fix-ree-util-bug

Conversation

@lesterfan

@lesterfan lesterfan commented Feb 13, 2025 •

Copy link
Copy Markdown
Contributor

Rationale for this change

This change makes the returned schema more correct pending discussion in #45534.

What changes are included in this PR?

For every column which is run-end-encoded in RunEndEncodeTableColumns, the corresponding schema field will be changed to also be run-end-encoded.

Are these changes tested?

Yes

Are there any user-facing changes?

no, this fixes a bug in a gtest util which is user-facing.

@github-actions

Copy link
Copy Markdown

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

@pitrou

pitrou commented Apr 3, 2025

Copy link
Copy Markdown
Member

@felipecrv Do you want to take a quick look at this PR?

@lesterfan

Copy link
Copy Markdown
Contributor Author

Noting that I just edited the linked issue: #45534 (comment)

@mapleFU mapleFU left a comment

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.

2 nits, but I'm ok to merge this since it's just for testing

I've validate this is wrong with:

diff --git a/cpp/src/arrow/acero/hash_aggregate_test.cc b/cpp/src/arrow/acero/hash_aggregate_test.cc
index dce0e44eb1..7e2164fca4 100644
--- a/cpp/src/arrow/acero/hash_aggregate_test.cc
+++ b/cpp/src/arrow/acero/hash_aggregate_test.cc
@@ -775,6 +775,7 @@ TEST_P(GroupBy, CountOnly) {
         if (!re_encode_cols.empty()) {
           ASSERT_OK_AND_ASSIGN(transformed_table,
                                RunEndEncodeTableColumns(*table, re_encode_cols));
+          ASSERT_OK(transformed_table->ValidateFull());
         }

Comment thread cpp/src/arrow/testing/gtest_util.cc Outdated
std::vector<std::shared_ptr<Field>> encoded_fields;
encoded_fields.reserve(num_columns);
for (int i = 0; i < num_columns; i++) {
auto field = table.schema()->field(i);

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.

nit:

Suggested change
auto field = table.schema()->field(i);
auto& field = table.schema()->field(i);

Comment thread cpp/src/arrow/testing/gtest_util.cc Outdated
}
}
return Table::Make(table.schema(), std::move(encoded_columns));
auto updated_schema = arrow::schema(encoded_fields);

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.

Suggested change
auto updated_schema = arrow::schema(encoded_fields);
auto updated_schema = arrow::schema(std::move(encoded_fields));

@mapleFU

mapleFU commented Apr 11, 2025

Copy link
Copy Markdown
Member

Will merge after ci pass

@mapleFU

mapleFU commented Apr 11, 2025

Copy link
Copy Markdown
Member

Failed ci unrelated

@mapleFU mapleFU changed the title GH-45534: [C++] RunEndEncodeTableColumns should update run-end-encoded columns' schema types GH-45534: [C++] Test: RunEndEncodeTableColumns should update REE columns' schema types Apr 11, 2025
@mapleFU
mapleFU merged commit f6b8557 into apache:main Apr 11, 2025
@lesterfan

Copy link
Copy Markdown
Contributor Author

Thank you for the review @mapleFU!

@lesterfan
lesterfan deleted the fix-ree-util-bug branch April 12, 2025 00:11
@conbench-apache-arrow

Copy link
Copy Markdown

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

There were no benchmark performance regressions. 🎉

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

zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Apr 15, 2025
…REE columns' schema types (apache#45535)

### Rationale for this change

This change makes the returned schema more correct pending discussion in apache#45534.

### What changes are included in this PR?

For every column which is run-end-encoded in `RunEndEncodeTableColumns`, the corresponding schema field will be changed to also be run-end-encoded.

### Are these changes tested?

Yes

### Are there any user-facing changes?

no, this fixes a bug in a gtest util which is user-facing.

* GitHub Issue: apache#45534

Lead-authored-by: Lester Fan <lesterfan37@gmail.com>
Co-authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: mwish <maplewish117@gmail.com>
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.

3 participants