westonpace commented on code in PR #13501:
URL: https://github.com/apache/arrow/pull/13501#discussion_r949449019
##########
cpp/src/arrow/compute/exec/hash_join_node_test.cc:
##########
@@ -1801,6 +1802,42 @@ TEST(HashJoin, UnsupportedTypes) {
}
}
+TEST(HashJoin, ExtensionTypes) {
+ auto ext_arr = ExampleUuid();
+ auto l_int_arr = ArrayFromJSON(int32(), "[1, 2, 3, 4]");
+ auto r_int_arr = ArrayFromJSON(int32(), "[1, 2, 3, 4]");
+ auto bin_arr = ArrayFromJSON(
+ fixed_size_binary(16),
+ "[null, \"abcdefghijklmno0\", \"abcdefghijklmno1\",
\"abcdefghijklmno2\"]");
+ const bool parallel = false;
+ std::vector<FieldRef> l_keys{{"l_0"}};
+ std::vector<FieldRef> r_keys{{"r_0"}};
+
+ HashJoinNodeOptions join_options{JoinType::INNER,
+ {FieldRef("l_0")},
+ {FieldRef("r_0")},
+ {FieldRef("l_0"), FieldRef("l_1")},
+ {FieldRef("r_0"), FieldRef("r_1")},
+ {JoinKeyCmp::EQ}};
+
+ std::shared_ptr<Schema> output_schema =
+ schema({field("l_0", int32()), field("l_1", fixed_size_binary(16)),
+ field("r_0", int32()), field("r_1", uuid())});
+
+ Random64Bit rng(42);
+ ASSERT_OK_AND_ASSIGN(
+ auto batches,
+ HashJoinWithExecPlan(rng, parallel, join_options, output_schema,
+ {l_int_arr, bin_arr}, {r_int_arr, ext_arr}, 4, 4));
+ ASSERT_OK_AND_ASSIGN(auto output_rows_test,
+ TableFromExecBatches(output_schema, batches));
+ auto table =
+ arrow::Table::Make(output_schema, {l_int_arr, bin_arr, r_int_arr,
ext_arr}, 4);
Review Comment:
Minor nit: Can we call this `expected_table` or just `expected`?
##########
python/pyarrow/tests/test_exec_plan.py:
##########
@@ -28,6 +28,24 @@
pytestmark = pytest.mark.dataset
+class UuidType(pa.PyExtensionType):
Review Comment:
Given that this is also in `test_extension_type.py` do we want to make a
common place for this and import instead of repeating? I don't feel too
strongly here as it isn't much repetition.
--
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]