Class PruneLiteralsInChangePointBy


public final class PruneLiteralsInChangePointBy extends OptimizerRules.OptimizerRule<ChangePoint>
Prune foldable groupings from CHANGE_POINT BY. A foldable expression evaluates to the same constant for every row, so it has no grouping effect and can be dropped. Unlike PruneLiteralsInLimitBy, an all-foldable BY clause simply degenerates to an ungrouped CHANGE_POINT — there is no simpler plan node to substitute. Groupings arrive from the parser as either raw Attributes or Alias nodes wrapping the expression (introduced by ReplaceChangePointByExpressionWithEval). Expression.foldable() is always false, so we unwrap to check the child.