shounakmk219 commented on code in PR #12417:
URL: https://github.com/apache/pinot/pull/12417#discussion_r1503661878


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java:
##########
@@ -1660,10 +1640,25 @@ static String getActualColumnName(String rawTableName, 
String columnName, @Nulla
       return columnName;
     }
     String columnNameToCheck;
-    if (columnName.regionMatches(ignoreCase, 0, rawTableName, 0, 
rawTableName.length())
-        && columnName.length() > rawTableName.length() && 
columnName.charAt(rawTableName.length()) == '.') {
-      columnNameToCheck = ignoreCase ? 
columnName.substring(rawTableName.length() + 1).toLowerCase()
-          : columnName.substring(rawTableName.length() + 1);
+    String resolvedColumnName = columnName;
+    if (rawTableName.contains(".")) { // table name has database prefix
+      String databaseName = rawTableName.split("\\.")[0];

Review Comment:
   Previous logic is still valid and present at new line # 1657. 
   This code is only trying to handle the case when user queries something like 
`select tb1.col1 from db1.tb1` or `select tb1.col1 from tb1` with right 
database header. In such cases we need to prefix the whole column literal with 
the database name as the following logic is based on rawTableName which is the 
physical table name and will have database prefix.



-- 
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-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to