siddharthteotia commented on code in PR #10565:
URL: https://github.com/apache/pinot/pull/10565#discussion_r1162447859


##########
pinot-core/src/main/java/org/apache/pinot/core/query/request/context/QueryContext.java:
##########
@@ -144,20 +141,34 @@ private QueryContext(@Nullable String tableName, 
@Nullable QueryContext subquery
     _explain = explain;
   }
 
+  public DataSourceContext getDataSource() {
+    return _dataSource;
+  }
+
   /**
    * Returns the table name.
-   * NOTE: on the broker side, table name might be {@code null} when subquery 
is available.
    */
   public String getTableName() {
-    return _tableName;
+    if (_dataSource.getSubquery() != null) {
+      return _dataSource.getSubquery().getTableName();
+    }
+    if (_dataSource.getTableName() != null) {
+      return _dataSource.getTableName();
+    }
+    assert _dataSource.getJoin() != null;
+    return _dataSource.getJoin().getLeftTableName();

Review Comment:
   Not sure I follow this. Why should this return left table name in case of 
JOIN query ?



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