pitrou commented on code in PR #41614:
URL: https://github.com/apache/arrow/pull/41614#discussion_r1600349209
##########
cpp/src/arrow/acero/asof_join_node_test.cc:
##########
@@ -1678,5 +1678,55 @@ TEST(AsofJoinTest, BackpressureWithBatchesGen) {
/*slow_r0=*/false);
}
+TEST(AsofJoinTest, GH40675) {
+ auto left_batch = ExecBatchFromJSON(
+ {int64(), utf8()}, R"([[1, "a"], [1, "b"], [5, "a"], [6, "b"], [7,
"f"]])");
+ auto right_batch = ExecBatchFromJSON(
+ {int64(), utf8(), float64()}, R"([[2, "a", 1.0], [9, "b", 3.0], [15,
"g", 5.0]])");
+
+ Declaration left{
+ "exec_batch_source",
+ ExecBatchSourceNodeOptions(schema({field("colA", int64()), field("col2",
utf8())}),
+ {std::move(left_batch)})};
+ Declaration right{
+ "exec_batch_source",
+ ExecBatchSourceNodeOptions(schema({field("colB", int64()), field("col3",
utf8()),
+ field("colC", float64())}),
+ {std::move(right_batch)})};
+ AsofJoinNodeOptions asof_join_opts({{{"colA"}, {{"col2"}}}, {{"colB"},
{{"col3"}}}}, 1);
+ Declaration asof_join{
+ "asofjoin", {std::move(left), std::move(right)},
std::move(asof_join_opts)};
+
+ ASSERT_OK_AND_ASSIGN(auto result,
DeclarationToExecBatches(std::move(asof_join)));
+
+ auto exp_batch = ExecBatchFromJSON(
+ {int64(), utf8(), float64()},
+ R"([[1, "a", 1.0], [1, "b", null], [5, "a", null], [6, "b", null], [7,
"f", null]])");
+ AssertExecBatchesEqualIgnoringOrder(result.schema, {exp_batch},
result.batches);
+}
+
+TEST(AsofJoinTest, GH41149) {
+ auto left_batch = ExecBatchFromJSON({int64()}, R"([[1], [2], [3]])");
Review Comment:
Thanks a lot!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]