File tree Expand file tree Collapse file tree
datafusion/physical-plan/src/joins/grace_hash_join Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1025,6 +1025,24 @@ impl GraceHashJoinStream {
10251025 continue ;
10261026 }
10271027
1028+ // If we decided not to repartition but skipped loading earlier,
1029+ // load now and poll again to avoid joining empty batches.
1030+ if left_fut. is_none ( ) {
1031+ * left_fut = Some ( load_partition_async (
1032+ Arc :: clone ( & self . spill_left ) ,
1033+ work. left . clone ( ) ,
1034+ Arc :: clone ( & self . reservation ) ,
1035+ Arc :: clone ( left_bytes) ,
1036+ ) ) ;
1037+ * right_fut = Some ( load_partition_async (
1038+ Arc :: clone ( & self . spill_right ) ,
1039+ work. right . clone ( ) ,
1040+ Arc :: clone ( & self . reservation ) ,
1041+ Arc :: clone ( right_bytes) ,
1042+ ) ) ;
1043+ continue ;
1044+ }
1045+
10281046 let stream = build_in_memory_join_stream (
10291047 Arc :: clone ( & self . schema ) ,
10301048 Arc :: clone ( & self . left_input_schema ) ,
You can’t perform that action at this time.
0 commit comments