MCPcopy Create free account
hub / github.com/apache/arrow / TestSimpleJoinHelper

Function TestSimpleJoinHelper

cpp/src/arrow/acero/hash_join_node_test.cc:1759–1786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1757}
1758
1759void TestSimpleJoinHelper(BatchesWithSchema input_left, BatchesWithSchema input_right,
1760 BatchesWithSchema expected) {
1761 AsyncGenerator<std::optional<ExecBatch>> sink_gen;
1762
1763 Declaration left{"source",
1764 SourceNodeOptions{input_left.schema, input_left.gen(/*parallel=*/false,
1765 /*slow=*/false)}};
1766 Declaration right{
1767 "source", SourceNodeOptions{input_right.schema, input_right.gen(/*parallel=*/false,
1768 /*slow=*/false)}};
1769
1770 HashJoinNodeOptions join_opts{JoinType::INNER,
1771 /*left_keys=*/{"lkey"},
1772 /*right_keys=*/{"rkey"}, literal(true), "_l", "_r"};
1773
1774 Declaration join{"hashjoin", {std::move(left), std::move(right)}, join_opts};
1775
1776 ASSERT_OK_AND_ASSIGN(auto result, DeclarationToExecBatches(std::move(join)));
1777
1778 ASSERT_OK_AND_ASSIGN(auto output_rows_test,
1779 TableFromExecBatches(result.schema, result.batches));
1780 ASSERT_OK_AND_ASSIGN(auto expected_rows_test,
1781 TableFromExecBatches(expected.schema, expected.batches));
1782
1783 AssertTablesEqual(*output_rows_test, *expected_rows_test, /*same_chunk_layout=*/false,
1784 /*flatten=*/true);
1785 AssertSchemaEqual(expected.schema, result.schema);
1786}
1787
1788TEST(HashJoin, ExtensionTypesSwissJoin) {
1789 // For simpler types swiss join will be used.

Callers 1

TESTFunction · 0.85

Calls 3

AssertTablesEqualFunction · 0.85
literalFunction · 0.50
genMethod · 0.45

Tested by

no test coverage detected