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


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/request/RequestUtils.java:
##########
@@ -266,10 +267,20 @@ public static String prettyPrint(Expression expression) {
   }
 
   public static String getTableName(PinotQuery pinotQuery) {
-    while (pinotQuery.getDataSource().getSubquery() != null) {
-      pinotQuery = pinotQuery.getDataSource().getSubquery();
+    return getTableName(pinotQuery.getDataSource());
+  }
+
+  public static String getTableName(DataSource dataSource) {
+    if (dataSource.getSubquery() != null) {
+      return getTableName(dataSource.getSubquery());
+    }
+    if (dataSource.getTableName() != null) {
+      return dataSource.getTableName();
+    }

Review Comment:
   I am not sure why first and second conditions / cases are being treated as 
mutually exclusive in a couple of places in the code.



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