calcite
calcite copied to clipboard
[CALCITE-3438] Validator should disallow use of the GROUPING function inside a FILTER clause
AggVisitor
ignores to find grouping functions in default. However, for some cases we need to consider these functions. This PR adds an interface to control its beheavior, and tries for fix the issue described in CALCITE-3438.
Grouping function is a special agg function. +1 to find it in AggFinder
.
Rather than switching the config of boolean grouping
in validator, do we consider to add another interface for AggFinder
, something like findGrouping
?
@jinxing64 I ever consider to do in that way. However, I found there are already 5 AggFinder
s in SqlValidatorImp
. I'm not sure whether it is a good choice. So I propose this fix first, and waiting for reviewers' advices.