andygrove commented on code in PR #3757:
URL: https://github.com/apache/datafusion-comet/pull/3757#discussion_r2971648120


##########
spark/src/main/scala/org/apache/comet/serde/aggregates.scala:
##########
@@ -671,6 +672,62 @@ object CometBloomFilterAggregate extends 
CometAggregateExpressionSerde[BloomFilt
   }
 }
 
+object CometPercentile extends CometAggregateExpressionSerde[Percentile] {
+  override def convert(
+      aggExpr: AggregateExpression,
+      expr: Percentile,
+      inputs: Seq[Attribute],
+      binding: Boolean,
+      conf: SQLConf): Option[ExprOuterClass.AggExpr] = {
+
+    // Only support when frequency is Literal(1L) - i.e., percentile_cont 
behavior
+    expr.frequencyExpression match {
+      case Literal(1L, LongType) =>
+      case _ =>
+        withInfo(aggExpr, "weighted percentile not supported")
+        return None
+    }
+
+    // Only support scalar percentile, not array of percentiles
+    if (expr.percentageExpression.dataType.isInstanceOf[ArrayType]) {
+      withInfo(aggExpr, "array of percentiles not supported")
+      return None
+    }
+
+    // Support numeric types and interval types
+    expr.child.dataType match {
+      case _: NumericType =>
+      case _: DecimalType =>

Review Comment:
   
   The match on `DecimalType` is unreachable (because `NumericType` already 
handles it)
   
   ```suggestion
   ```



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