diff --git a/expression/aggregation/window_func.go b/expression/aggregation/window_func.go index e7c37c88414a2..820389b0f1542 100644 --- a/expression/aggregation/window_func.go +++ b/expression/aggregation/window_func.go @@ -131,7 +131,8 @@ func (s *WindowFuncDesc) CanPushDownToTiFlash(ctx sessionctx.Context) bool { } // window functions switch s.Name { - case ast.WindowFuncRowNumber, ast.WindowFuncRank, ast.WindowFuncDenseRank, ast.WindowFuncLead, ast.WindowFuncLag: + case ast.WindowFuncRowNumber, ast.WindowFuncRank, ast.WindowFuncDenseRank, ast.WindowFuncLead, ast.WindowFuncLag, + ast.WindowFuncFirstValue, ast.WindowFuncLastValue: return true // TODO: support aggregate functions //case ast.AggFuncSum, ast.AggFuncCount, ast.AggFuncAvg, ast.AggFuncMax, ast.AggFuncMin: diff --git a/planner/core/exhaust_physical_plans.go b/planner/core/exhaust_physical_plans.go index 33e254a331345..caf6491946db3 100644 --- a/planner/core/exhaust_physical_plans.go +++ b/planner/core/exhaust_physical_plans.go @@ -2775,6 +2775,9 @@ func (lw *LogicalWindow) tryToGetMppWindows(prop *property.PhysicalProperty) []P "MPP mode may be blocked because window function frame can't be pushed down, because " + err.Error()) return nil } + lw.SCtx().GetSessionVars().RaiseWarningWhenMPPEnforced( + "MPP mode may be blocked because window function frame can't be pushed down, because TiFlash does not support range frame type yet.") + return nil } }