xuzifu666 commented on code in PR #4919:
URL: https://github.com/apache/calcite/pull/4919#discussion_r3196153158


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -882,31 +882,27 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding 
operatorBinding,
       SqlStdOperatorTable.ARG_MIN.withName("MIN_BY");
 
   /** The {@code PERCENTILE_CONT} function, BigQuery's
-   * equivalent to {@link SqlStdOperatorTable#PERCENTILE_CONT},
-   * but uses an {@code OVER} clause rather than {@code WITHIN GROUP}. */
+   * equivalent to {@link SqlStdOperatorTable#PERCENTILE_CONT}. */
   @LibraryOperator(libraries = {BIG_QUERY})
   public static final SqlAggFunction PERCENTILE_CONT2 =
       SqlBasicAggFunction
           .create("PERCENTILE_CONT", SqlKind.PERCENTILE_CONT,
               ReturnTypes.DOUBLE,
               OperandTypes.NUMERIC_UNIT_INTERVAL_NUMERIC_LITERAL)
           .withFunctionType(SqlFunctionCategory.SYSTEM)
-          .withOver(true)
           .withPercentile(true)
           .withAllowsNullTreatment(true)
           .withAllowsFraming(false);
 
   /** The {@code PERCENTILE_DISC} function, BigQuery's
-   * equivalent to {@link SqlStdOperatorTable#PERCENTILE_DISC},
-   * but uses an {@code OVER} clause rather than {@code WITHIN GROUP}. */
+   * equivalent to {@link SqlStdOperatorTable#PERCENTILE_DISC}. */
   @LibraryOperator(libraries = {BIG_QUERY})
   public static final SqlAggFunction PERCENTILE_DISC2 =
       SqlBasicAggFunction
           .create("PERCENTILE_DISC", SqlKind.PERCENTILE_DISC,
               ReturnTypes.ARG0,
               OperandTypes.NUMERIC_UNIT_INTERVAL_NUMERIC_LITERAL)
           .withFunctionType(SqlFunctionCategory.SYSTEM)
-          .withOver(true)

Review Comment:
   The previous code incorrectly marked BigQuery's PERCENTILE_CONT2 as 
requiresOver=true, but the test actually used its aggregate function form 
percentile_cont(1, .5), which naturally does not require OVER, so here changed 
it.



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

Reply via email to