gortiz commented on code in PR #14797:
URL: https://github.com/apache/pinot/pull/14797#discussion_r1919074014


##########
pinot-query-runtime/src/test/resources/queries/QueryHints.json:
##########
@@ -125,6 +125,14 @@
         "description": "Colocated JOIN with partition column and group by 
non-partitioned column with stage parallelism",
         "sql": "SET stageParallelism=2; SELECT {tbl1}.name, SUM({tbl2}.num) 
FROM {tbl1} /*+ tableOptions(partition_function='hashcode', 
partition_key='num', partition_size='4') */ JOIN {tbl2} /*+ 
tableOptions(partition_function='hashcode', partition_key='num', 
partition_size='4') */ ON {tbl1}.num = {tbl2}.num GROUP BY {tbl1}.name"
       },
+      {
+        "description": "Broadcast JOIN without partition hint",
+        "sql": "SELECT /*+ joinOptions(left_exchange_type = 'local', 
right_exchange_type = 'broadcast') */ {tbl1}.num, {tbl1}.name, {tbl2}.num, 
{tbl2}.val FROM {tbl1} JOIN {tbl2} ON {tbl1}.num = {tbl2}.num"

Review Comment:
   Shouldn't be better to create a new hint for exchanges instead of assigning 
it to the join?
   
   The way I'm suggesting the query would be something like:
   ```sql
   SELECT 
       {tbl1}.num, {tbl1}.name, {tbl2}.num, {tbl2}.val
   FROM {tbl1} /*+ exchangeOption(type = 'local') */
   JOIN {tbl2} /*+ exchangeOption(type = 'broadcast') */
   ON {tbl1}.num = {tbl2}.num;
   ```
   
   This could also be used for example in aggregates. For example, we could 
write something like:
   ```sql
   
   SELECT
       {tbl1}.num, count(*)
   from {tbl1} /*+ exchangeOption(type = 'local') */
   GROUP BY {tbl1}.num;
   ```
   



-- 
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