Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,11 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde {
return None
}

// Aggregate expressions with filter are not supported yet.
if (aggregateExpressions.exists(_.filter.isDefined)) {
return None
}

val groupingExprs = groupingExpressions.map(exprToProto(_, child.output))

// In some of the cases, the aggregateExpressions could be empty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ import org.apache.comet.CometSparkSessionExtensions.isSpark34Plus
class CometAggregateSuite extends CometTestBase with AdaptiveSparkPlanHelper {
import testImplicits._

test("count with aggregation filter") {
withSQLConf(
CometConf.COMET_ENABLED.key -> "true",
CometConf.COMET_EXEC_SHUFFLE_ENABLED.key -> "true",
CometConf.COMET_COLUMNAR_SHUFFLE_ENABLED.key -> "true") {
val df1 = sql("SELECT count(DISTINCT 2), count(DISTINCT 2,3)")
checkSparkAnswer(df1)

val df2 = sql("SELECT count(DISTINCT 2), count(DISTINCT 3,2)")
checkSparkAnswer(df2)
}
}

test("lead/lag should return the default value if the offset row does not exist") {
withSQLConf(
CometConf.COMET_ENABLED.key -> "true",
Expand Down