@@ -64,7 +64,6 @@ use crate::plans::DropRolePlan;
64
64
use crate :: plans:: DropStagePlan ;
65
65
use crate :: plans:: DropUserPlan ;
66
66
use crate :: plans:: Plan ;
67
- use crate :: plans:: RelOperator ;
68
67
use crate :: plans:: RewriteKind ;
69
68
use crate :: plans:: ShowConnectionsPlan ;
70
69
use crate :: plans:: ShowFileFormatsPlan ;
@@ -106,7 +105,7 @@ pub struct Binder {
106
105
pub subquery_executor : Option < Arc < dyn QueryExecutor > > ,
107
106
}
108
107
109
- impl < ' a > Binder {
108
+ impl Binder {
110
109
pub fn new (
111
110
ctx : Arc < dyn TableContext > ,
112
111
catalogs : Arc < CatalogManager > ,
@@ -952,110 +951,6 @@ impl<'a> Binder {
952
951
Ok ( finder. scalars ( ) . is_empty ( ) )
953
952
}
954
953
955
- #[ allow( dead_code) ]
956
- pub ( crate ) fn check_sexpr_top ( & self , s_expr : & SExpr ) -> Result < bool > {
957
- let f = |scalar : & ScalarExpr | matches ! ( scalar, ScalarExpr :: UDFCall ( _) ) ;
958
- let mut finder = Finder :: new ( & f) ;
959
- Self :: check_sexpr ( s_expr, & mut finder)
960
- }
961
-
962
- #[ recursive:: recursive]
963
- pub ( crate ) fn check_sexpr < F > ( s_expr : & ' a SExpr , f : & ' a mut Finder < ' a , F > ) -> Result < bool >
964
- where F : Fn ( & ScalarExpr ) -> bool {
965
- let result = match s_expr. plan . as_ref ( ) {
966
- RelOperator :: Scan ( scan) => {
967
- f. reset_finder ( ) ;
968
- if let Some ( agg_info) = & scan. agg_index {
969
- for predicate in & agg_info. predicates {
970
- f. visit ( predicate) ?;
971
- }
972
- for selection in & agg_info. selection {
973
- f. visit ( & selection. scalar ) ?;
974
- }
975
- }
976
- if let Some ( predicates) = & scan. push_down_predicates {
977
- for predicate in predicates {
978
- f. visit ( predicate) ?;
979
- }
980
- }
981
- f. scalars ( ) . is_empty ( )
982
- }
983
- RelOperator :: Join ( join) => {
984
- f. reset_finder ( ) ;
985
- for condition in join. equi_conditions . iter ( ) {
986
- f. visit ( & condition. left ) ?;
987
- f. visit ( & condition. right ) ?;
988
- }
989
- for condition in & join. non_equi_conditions {
990
- f. visit ( condition) ?;
991
- }
992
- f. scalars ( ) . is_empty ( )
993
- }
994
- RelOperator :: EvalScalar ( eval) => {
995
- f. reset_finder ( ) ;
996
- for item in & eval. items {
997
- f. visit ( & item. scalar ) ?;
998
- }
999
- f. scalars ( ) . is_empty ( )
1000
- }
1001
- RelOperator :: Filter ( filter) => {
1002
- f. reset_finder ( ) ;
1003
- for predicate in & filter. predicates {
1004
- f. visit ( predicate) ?;
1005
- }
1006
- f. scalars ( ) . is_empty ( )
1007
- }
1008
- RelOperator :: Aggregate ( aggregate) => {
1009
- f. reset_finder ( ) ;
1010
- for item in & aggregate. group_items {
1011
- f. visit ( & item. scalar ) ?;
1012
- }
1013
- for item in & aggregate. aggregate_functions {
1014
- f. visit ( & item. scalar ) ?;
1015
- }
1016
- f. scalars ( ) . is_empty ( )
1017
- }
1018
- RelOperator :: Exchange ( exchange) => {
1019
- f. reset_finder ( ) ;
1020
- if let crate :: plans:: Exchange :: Hash ( hash) = exchange {
1021
- for scalar in hash {
1022
- f. visit ( scalar) ?;
1023
- }
1024
- }
1025
- f. scalars ( ) . is_empty ( )
1026
- }
1027
- RelOperator :: Window ( window) => {
1028
- f. reset_finder ( ) ;
1029
- for scalar_item in & window. arguments {
1030
- f. visit ( & scalar_item. scalar ) ?;
1031
- }
1032
- for scalar_item in & window. partition_by {
1033
- f. visit ( & scalar_item. scalar ) ?;
1034
- }
1035
- for info in & window. order_by {
1036
- f. visit ( & info. order_by_item . scalar ) ?;
1037
- }
1038
- f. scalars ( ) . is_empty ( )
1039
- }
1040
- RelOperator :: Udf ( _) => false ,
1041
- _ => true ,
1042
- } ;
1043
-
1044
- match result {
1045
- true => {
1046
- for child in & s_expr. children {
1047
- let mut finder = Finder :: new ( f. find_fn ( ) ) ;
1048
- let flag = Self :: check_sexpr ( child. as_ref ( ) , & mut finder) ?;
1049
- if !flag {
1050
- return Ok ( false ) ;
1051
- }
1052
- }
1053
- Ok ( true )
1054
- }
1055
- false => Ok ( false ) ,
1056
- }
1057
- }
1058
-
1059
954
pub ( crate ) fn check_allowed_scalar_expr_with_subquery_for_copy_table (
1060
955
& self ,
1061
956
scalar : & ScalarExpr ,
0 commit comments