siddharthteotia commented on a change in pull request #4535: Implement DISTINCT 
clause
URL: https://github.com/apache/incubator-pinot/pull/4535#discussion_r318297586
 
 

 ##########
 File path: 
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
 ##########
 @@ -145,12 +148,12 @@ private static PinotQuery 
compileCalciteSqlToPinotQuery(String sql) {
         DataSource dataSource = new DataSource();
         dataSource.setTableName(selectSqlNode.getFrom().toString());
         pinotQuery.setDataSource(dataSource);
-        
pinotQuery.setSelectList(convertSelectList(selectSqlNode.getSelectList()));
+        
pinotQuery.setSelectList(convertSelectList(selectSqlNode.getSelectList(), 
selectSqlNode.getModifierNode(SqlSelectKeyword.DISTINCT)));
 
 Review comment:
   DISTINCT is implemented as a keyword in Calcite SQL and thus it is not part 
of SqlSelect.getSelectList() in Calcite. Therefore the existing implementation 
of convertSelectList() will not handle DISTINCT implicitly. We had to look at 
the keyword list and pass that down to convertSelectList().

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to