amrishlal commented on a change in pull request #7959:
URL: https://github.com/apache/pinot/pull/7959#discussion_r792950135



##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
##########
@@ -1487,6 +1498,46 @@ static void updateColumnNames(String rawTableName, 
PinotQuery pinotQuery, boolea
     }
   }
 
+  private static void expandStarExpressionToActualColumns(PinotQuery 
pinotQuery, Map<String, String> columnNameMap,
+      Expression selectStarExpr) {
+    List<Expression> originalSelections = pinotQuery.getSelectList();
+    // Avoid using stream apis in query path because we have found that it has 
poorer performance compared to
+    // regular apis.
+    Set<String> originallySelectedColumnNames = new HashSet<>();
+    for (Expression originalSelection : originalSelections) {
+      if (originalSelection.isSetIdentifier()) {
+        
originallySelectedColumnNames.add(originalSelection.getIdentifier().getName());
+      }
+    }
+    List<Expression> newSelections = new ArrayList<>();
+    for (Expression selection : originalSelections) {
+      if (selection.equals(selectStarExpr)) {
+        //expand '*' to actual columns, exclude default virtual columns
+        for (String tableCol : columnNameMap.values()) {
+          //we exclude default virtual columns and those columns that are 
already a part of originalSelections (to
+          // dedup columns that are selected multiple times)

Review comment:
       Also from what I can see queries like `SELECT playerID, playerID FROM 
baseballStats` are currently supported in Pinot without the deduce. So whatever 
scheme we pick should be consistent otherwise it will cause confusion later and 
be difficult to change.




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