Skip to content

Commit

Permalink
Add physical plan sqllogictest
Browse files Browse the repository at this point in the history
  • Loading branch information
eejbyfeldt committed Oct 27, 2024
1 parent 6ddce2e commit 3c72e37
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 1 addition & 2 deletions datafusion/physical-plan/src/joins/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,7 @@ pub(crate) fn get_final_indices_from_bit_map(
) -> (UInt64Array, UInt32Array) {
let left_size = left_bit_map.len();
if join_type == JoinType::LeftMark {
let left_indices = (0..left_size)
.map(|idx| idx as u64)
let left_indices = (0..left_size as u64)
.collect::<UInt64Array>();
let right_indices = (0..left_size)
.map(|idx| left_bit_map.get_bit(idx).then_some(0))
Expand Down
19 changes: 19 additions & 0 deletions datafusion/sqllogictest/test_files/subquery.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,9 @@ where t1.t1_id > 40 or exists (select * from t2 where t1.t1_id = t2.t2_id)
22 b 2
44 d 4

statement ok
set datafusion.explain.logical_plan_only = false;

# not_exists_subquery_to_join_with_correlated_outer_filter_disjunction
query TT
explain select t1.t1_id,
Expand All @@ -1142,6 +1145,22 @@ logical_plan
04)------TableScan: t1 projection=[t1_id, t1_name, t1_int]
05)------SubqueryAlias: __correlated_sq_1
06)--------TableScan: t2 projection=[t2_id]
physical_plan
01)CoalesceBatchesExec: target_batch_size=2
02)--FilterExec: t1_id@0 > 40 OR NOT mark@3, projection=[t1_id@0, t1_name@1, t1_int@2]
03)----CoalesceBatchesExec: target_batch_size=2
04)------HashJoinExec: mode=Partitioned, join_type=LeftMark, on=[(t1_id@0, t2_id@0)]
05)--------CoalesceBatchesExec: target_batch_size=2
06)----------RepartitionExec: partitioning=Hash([t1_id@0], 4), input_partitions=4
07)------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1
08)--------------MemoryExec: partitions=1, partition_sizes=[1]
09)--------CoalesceBatchesExec: target_batch_size=2
10)----------RepartitionExec: partitioning=Hash([t2_id@0], 4), input_partitions=4
11)------------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1
12)--------------MemoryExec: partitions=1, partition_sizes=[1]

statement ok
set datafusion.explain.logical_plan_only = true;

query ITI rowsort
select t1.t1_id,
Expand Down

0 comments on commit 3c72e37

Please sign in to comment.