| 1757 | } |
| 1758 | |
| 1759 | void 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 | |
| 1788 | TEST(HashJoin, ExtensionTypesSwissJoin) { |
| 1789 | // For simpler types swiss join will be used. |
no test coverage detected