599166320 commented on issue #14535:
URL: https://github.com/apache/druid/issues/14535#issuecomment-1770408930

   @abhishekagarwal87 
   
   These are great questions.
   
   Let's assume we continue to analyze the query execution process based on the 
Druid cluster deployment architecture mentioned earlier.
   
   A user in the Singapore Druid console executes an SQL query to calculate the 
average, as follows:
   
   ```
   SELECT AVG(delta), SUM(delta)/COUNT(*) from wikipedia
   ```
   
   When the SQL statement reaches the broker process in Singapore, the broker 
converts the SQL into a `native query`. During the conversion, it transforms 
`AVG` into `SUM` and `COUNT`. 
   
   
![image](https://github.com/apache/druid/assets/3204398/07f3916f-0f3c-46ad-b55e-a84ebf570352)
   
   
   Then, it distributes the `native query to` all Historical nodes in 
Singapore. Simultaneously, it checks the context for the presence of 
`federatedClusterBrokers.` If they exist, it conveniently distributes the 
`native query` to all Druid clusters that require federated queries. This 
distribution is carried out through the entry broker of the federated cluster, 
which further dispatches the query to the Historical nodes of each federated 
cluster.
   
   
   The broker of each federated cluster aggregates its own cluster's data and 
returns it to the Singapore broker. The Singapore broker aggregates all the 
data and responds to the user. In summary, federatedClusterBrokers serve a 
function similar to a Historical node.
   
   In general, whether the data from different data centers is disjoint is 
irrelevant. Aggregation functions such as `AVG`, `COUNT(DISTINCT x)`, and 
others can be handled without concern.


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