You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/11/02 16:00:54 UTC

[GitHub] [druid] abhishekagarwal87 commented on a change in pull request #11809: Make subquery IDs more comprehensive

abhishekagarwal87 commented on a change in pull request #11809:
URL: https://github.com/apache/druid/pull/11809#discussion_r740761353



##########
File path: processing/src/main/java/org/apache/druid/query/UnionQueryRunner.java
##########
@@ -93,4 +102,25 @@ public UnionQueryRunner(
     }
   }
 
+  /**
+   * Appends and returns the name and the position of the individual datasource in the union with the parent query id
+   * if preseent
+   *
+   * @param parentSubqueryId The subquery Id of the parent query which is generating this subquery
+   * @param dataSourceName   Name of the datasource for which the UnionRunner is running
+   * @param dataSourceIndex  Position of the datasource for which the UnionRunner is running
+   * @return Subquery Id which needs to be populated
+   */
+  private String generateSubqueryId(String parentSubqueryId, String dataSourceName, int dataSourceIndex)
+  {
+    final String DELIMITER = "-";
+    List<String> arr = new ArrayList<>();

Review comment:
       do we need an array? 

##########
File path: server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java
##########
@@ -147,15 +151,23 @@ public ClientQuerySegmentWalker(
 
     // transform TableDataSource to GlobalTableDataSource when eligible
     // before further transformation to potentially inline
-    final DataSource freeTradeDataSource = globalizeIfPossible(query.getDataSource());
+
+    // Populate the subquery ids of the subquery id present in the main query
+    Query<T> newQuery = query.withDataSource(generateSubqueryIds(query.getDataSource(), "1"));

Review comment:
       ```suggestion
       Query<T> queryWithSubqueryIds = query.withDataSource(generateSubqueryIds(query.getDataSource(), "1"));
   ```




-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org