walterddr commented on code in PR #9907:
URL: https://github.com/apache/pinot/pull/9907#discussion_r1044649547


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/HashJoinOperator.java:
##########
@@ -42,48 +41,70 @@
 
 /**
  * This basic {@code BroadcastJoinOperator} implement a basic broadcast join 
algorithm.
+ * This algorithm assumes that the broadcast table has to fit in memory since 
we are not supporting any spilling.
  *
+ * For left join, inner join, right join and full join,
  * <p>It takes the right table as the broadcast side and materialize a hash 
table. Then for each of the left table row,
  * it looks up for the corresponding row(s) from the hash table and create a 
joint row.
  *
  * <p>For each of the data block received from the left table, it will 
generate a joint data block.
- *
- * We currently support left join, inner join and semi join.
+ * We currently support left join, inner join, right join and full join.
  * The output is in the format of [left_row, right_row]
  */
 // TODO: Move inequi out of hashjoin. 
(https://github.com/apache/pinot/issues/9728)
 public class HashJoinOperator extends BaseOperator<TransferableBlock> {
+  private class BroadcastRows {
+    public BroadcastRows(List<Object[]> rows, boolean hasMatch) {
+      _rows = rows;
+      _hasMatch = hasMatch;
+    }

Review Comment:
   alternatively we can also maintain 2 hashmaps
   ```
   private final HashMap<Key, List<Object[]>> _unmatchedHashTable;
   private final HashMap<Key, List<Object[]>> _matchedHashTable;
   ```
   and for the hash join, simply loop through both 
   1. for LEFT and INNER join, remain the same logic (the _matchHashTable will 
always be empty and thus no extra cost)
   2. for RIGHT and FULL join, move a row from _unmatch to _match onc the 
equality and inequality conditions are applied successfully. 
       - at the very end when a EOS block is reached on the left. simply output 
the right _umatched rows



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to