alex-plekhanov commented on a change in pull request #9009:
URL: https://github.com/apache/ignite/pull/9009#discussion_r617786322



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/trait/DistributionTrait.java
##########
@@ -142,7 +142,7 @@
                     && DistributionFunction.satisfy(function, other.function));
 
         if (other.getType() == RANDOM_DISTRIBUTED)
-            return getType() == HASH_DISTRIBUTED;
+            return getType() == HASH_DISTRIBUTED || getType() == SINGLETON;

Review comment:
       I do not quite understand. If `single` means that the plan node is 
allowed to execute only on one cluster node, then, for the MAP phase any input 
with `single` distribution should be prohibited. Since, if all inputs are 
single - `IgniteSingleMinus` node should be used, and if there is a mix of 
single and random plan nodes - random plan nodes should be converted to single 
with `IgniteExchange`. So, `IgniteMapMinus.deriveDistribution` should convert 
all inputs to `random`, or skip this plan if there is at least one `single` 
node. 
   
   I was thinking previously that `single` trait means that data for this plan 
node is located only on one cluster node (nevertheless plan node can be 
executed on different cluster nodes, the same for `broadcast`, it shows only 
data distribution, but not force plan node to be executed on every cluster 
node). In this case change with `single().satisfies(random())` looks fine. And 
this change makes possible some plans like:
   ```
   IgniteReduceMinus(all=[false])
     IgniteExchange(distribution=[single])
       IgniteMapMinus(all=[false])
         IgniteTableScan(table=[[PUBLIC, SINGLE_TBL1]])
         IgniteTableScan(table=[[PUBLIC, RANDOM_TBL1]])
   ```
   Should we prohibit such plans?




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

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


Reply via email to