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

 ##########
 File path: 
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
 ##########
 @@ -174,13 +185,24 @@ private static String removeOptionsFromSql(String sql) {
     return matcher.replaceAll("");
   }
 
+  private static List<Expression> convertDistinctSelectList(SqlNodeList 
selectList) {
+    List<Expression> selectExpr = new ArrayList<>();
+    if (!Pql2Compiler.ENABLE_DISTINCT) {
+      throw new SqlCompilationException("Support for DISTINCT is currently 
disabled in Pinot");
+    }
+    
selectExpr.add(convertDistinctAndSelectListToFunctionExpression(selectList));
+    return selectExpr;
+  }
+
   private static List<Expression> convertSelectList(SqlNodeList selectList) {
     List<Expression> selectExpr = new ArrayList<>();
+
     final Iterator<SqlNode> iterator = selectList.iterator();
     while (iterator.hasNext()) {
       final SqlNode next = iterator.next();
       selectExpr.add(toExpression(next));
 
 Review comment:
   Not part of this PR, but we should deduplicate the columns

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