You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/18 18:51:47 UTC

[GitHub] [arrow] rok commented on a diff in pull request #13501: ARROW-16695: [R][Python][C++] Extension types are not supported in joins

rok commented on code in PR #13501:
URL: https://github.com/apache/arrow/pull/13501#discussion_r949491953


##########
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:
   Changed to `expected_table`.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org