-
Notifications
You must be signed in to change notification settings - Fork 4.2k
ARROW-16904: [C++] min/max not deterministic if Parquet files have multiple row groups #13509
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
Changes from 8 commits
f2006f7
7cb37a7
f48390e
431609a
d5c7479
e60509e
fb16334
695e29b
5a3641f
fba6c8c
534691b
988b68b
249af7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -933,6 +933,38 @@ TEST(ExecPlanExecution, SourceGroupedSum) { | |||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| TEST(ExecPlanExecution, SourceMinMaxScalar) { | ||||||||
|
drin marked this conversation as resolved.
|
||||||||
| for (bool parallel : { false, true }) { | ||||||||
| SCOPED_TRACE(parallel ? "parallel/merged" : "serial"); | ||||||||
|
|
||||||||
| auto input = MakeGroupableBatches(/*multiplicity=*/parallel ? 100 : 1); | ||||||||
| auto minmax_opts = std::make_shared<ScalarAggregateOptions>(); | ||||||||
| auto expected_value = StructScalar::Make( | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit, but doesn't ScalarFromJSON handle StructScalar directly?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried looking at the function and searching for usages but I couldn't figure it out. If you know how to do it, I can update it. I wasn't sure if a StructScalar is essentially an object (e.g.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. arrow/cpp/src/arrow/ipc/json_simple.cc Lines 659 to 661 in 8042f00
should be |
||||||||
| ScalarVector{ScalarFromJSON(int32(), R"(-8)"), ScalarFromJSON(int32(), R"(12)")}, | ||||||||
| {"min","max"}); | ||||||||
| auto expected_result = ExecBatch::Make({*expected_value}); | ||||||||
|
|
||||||||
| ASSERT_OK_AND_ASSIGN(auto plan, ExecPlan::Make()); | ||||||||
| AsyncGenerator<util::optional<ExecBatch>> sink_gen; | ||||||||
|
|
||||||||
| // NOTE: Test `ScalarAggregateNode` by omitting `keys` attribute | ||||||||
| ASSERT_OK( | ||||||||
| Declaration::Sequence({ | ||||||||
| {"source", | ||||||||
| SourceNodeOptions {input.schema, input.gen(parallel, /*slow=*/false)}}, | ||||||||
| {"aggregate", AggregateNodeOptions{/*aggregates=*/{{"min_max", | ||||||||
| std::move(minmax_opts), | ||||||||
| "i32", "min_max"}}, | ||||||||
| /*keys=*/{}}}, | ||||||||
| {"sink", SinkNodeOptions{&sink_gen}} | ||||||||
| }) | ||||||||
| .AddToPlan(plan.get())); | ||||||||
|
|
||||||||
| ASSERT_THAT(StartAndCollect(plan.get(), sink_gen), | ||||||||
| Finishes(ResultWith(UnorderedElementsAreArray({*expected_result})))); | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| TEST(ExecPlanExecution, NestedSourceFilter) { | ||||||||
| for (bool parallel : {false, true}) { | ||||||||
| SCOPED_TRACE(parallel ? "parallel/merged" : "serial"); | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️ thank you!