Skip to content

Commit

Permalink
Test join on binary is hash join
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Nov 16, 2024
1 parent 5d92abc commit d1fa0eb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datafusion/sqllogictest/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ impl TestContext {
let example_udf = create_example_udf();
test_ctx.ctx.register_udf(example_udf);
register_partition_table(&mut test_ctx).await;
info!("Registering table with many types");
register_table_with_many_types(test_ctx.session_ctx()).await;
}
"metadata.slt" => {
info!("Registering metadata table tables");
Expand Down
21 changes: 21 additions & 0 deletions datafusion/sqllogictest/test_files/joins.slt
Original file line number Diff line number Diff line change
Expand Up @@ -4292,3 +4292,24 @@ query T
select * from table1 as t1 natural join table1_stringview as t2;
----
foo

query TT
EXPLAIN SELECT count(*)
FROM my_catalog.my_schema.table_with_many_types AS l
JOIN my_catalog.my_schema.table_with_many_types AS r ON l.binary_col = r.binary_col
----
logical_plan
01)Aggregate: groupBy=[[]], aggr=[[count(Int64(1)) AS count(*)]]
02)--Projection:
03)----Inner Join: l.binary_col = r.binary_col
04)------SubqueryAlias: l
05)--------TableScan: my_catalog.my_schema.table_with_many_types projection=[binary_col]
06)------SubqueryAlias: r
07)--------TableScan: my_catalog.my_schema.table_with_many_types projection=[binary_col]
physical_plan
01)AggregateExec: mode=Single, gby=[], aggr=[count(*)]
02)--ProjectionExec: expr=[]
03)----CoalesceBatchesExec: target_batch_size=3
04)------HashJoinExec: mode=CollectLeft, join_type=Inner, on=[(binary_col@0, binary_col@0)]
05)--------MemoryExec: partitions=1, partition_sizes=[1]
06)--------MemoryExec: partitions=1, partition_sizes=[1]

0 comments on commit d1fa0eb

Please sign in to comment.