@@ -28,11 +28,11 @@ bool ValueIsNan(const Value &value) {
2828// `struct_extract` chains. Anything else throws NotImplementedException —
2929// that gives the OPTIONAL_FILTER catch point a chance to swallow it.
3030struct ResolvedColumn {
31- vector<string > path;
31+ vector<Identifier > path;
3232 const ArrowType *leaf_type;
3333};
3434
35- ResolvedColumn ResolveColumn (const Expression &expr, const vector<string > &root_path, const ArrowType *root_type) {
35+ ResolvedColumn ResolveColumn (const Expression &expr, const vector<Identifier > &root_path, const ArrowType *root_type) {
3636 if (expr.GetExpressionClass () == ExpressionClass::BOUND_REF ) {
3737 return {root_path, root_type};
3838 }
@@ -47,8 +47,8 @@ ResolvedColumn ResolveColumn(const Expression &expr, const vector<string> &root_
4747 ExpressionTypeToString (expr.GetExpressionType ()));
4848 }
4949 // Recurse innermost-first so names accumulate root → leaf.
50- auto inner = ResolveColumn (*func.children [0 ], root_path, root_type);
51- inner.path .push_back (StructType::GetChildName (func.children [0 ]->GetReturnType (), child_idx));
50+ auto inner = ResolveColumn (*func.GetChildren () [0 ], root_path, root_type);
51+ inner.path .push_back (StructType::GetChildName (func.GetChildren () [0 ]->GetReturnType (), child_idx));
5252 if (inner.leaf_type ) {
5353 inner.leaf_type = &inner.leaf_type ->GetTypeInfo <ArrowStructInfo>().GetChild (child_idx);
5454 }
@@ -66,8 +66,8 @@ py::object EmitCompare(FilterBackend &backend, ExpressionType op, py::object col
6666
6767} // anonymous namespace
6868
69- py::object TransformExpression (const Expression &expression, const vector<string > &column_path, FilterBackend &backend ,
70- const ArrowType *arrow_type, const string &timezone_config) {
69+ py::object TransformExpression (const Expression &expression, const vector<Identifier > &column_path,
70+ FilterBackend &backend, const ArrowType *arrow_type, const string &timezone_config) {
7171 auto expression_class = expression.GetExpressionClass ();
7272 auto expression_type = expression.GetExpressionType ();
7373
@@ -93,7 +93,7 @@ py::object TransformExpression(const Expression &expression, const vector<string
9393
9494 auto resolved = ResolveColumn (*column_side, column_path, arrow_type);
9595 auto col = backend.MakeColumnRef (resolved.path );
96- return EmitCompare (backend, expression_type, std::move (col), constant_side->value , resolved.leaf_type ,
96+ return EmitCompare (backend, expression_type, std::move (col), constant_side->GetValue () , resolved.leaf_type ,
9797 timezone_config);
9898 }
9999
@@ -102,20 +102,22 @@ py::object TransformExpression(const Expression &expression, const vector<string
102102 // filters no longer have dedicated TableFilter subtypes. They arrive as scalar
103103 // function wrappers inside the ExpressionFilter expression tree (see
104104 // table_filter_functions.hpp).
105- const auto &func_name = bound_function_expression.function .GetName ();
105+ const auto &func_name = bound_function_expression.Function () .GetName ();
106106
107107 // OPTIONAL / SELECTIVITY_OPTIONAL wrap a child predicate that lives in `bind_info`
108108 // (their `children` hold only a placeholder column ref). An optional filter is never
109109 // required for correctness, so if its child can't be translated we push nothing for
110110 // it rather than failing the whole scan.
111111 if (func_name == OptionalFilterScalarFun::NAME || func_name == SelectivityOptionalFilterScalarFun::NAME ) {
112112 optional_ptr<const Expression> child;
113- if (bound_function_expression.bind_info ) {
113+ if (bound_function_expression.BindInfo () ) {
114114 if (func_name == OptionalFilterScalarFun::NAME ) {
115- child =
116- bound_function_expression.bind_info ->Cast <OptionalFilterFunctionData>().child_filter_expr .get ();
115+ child = bound_function_expression.BindInfo ()
116+ ->Cast <OptionalFilterFunctionData>()
117+ .child_filter_expr .get ();
117118 } else {
118- child = bound_function_expression.bind_info ->Cast <SelectivityOptionalFilterFunctionData>()
119+ child = bound_function_expression.BindInfo ()
120+ ->Cast <SelectivityOptionalFilterFunctionData>()
119121 .child_filter_expr .get ();
120122 }
121123 }
@@ -140,24 +142,24 @@ py::object TransformExpression(const Expression &expression, const vector<string
140142 if (expression_class == ExpressionClass::BOUND_OPERATOR ) {
141143 auto &op_expr = expression.Cast <BoundOperatorExpression>();
142144 if (expression_type == ExpressionType::OPERATOR_IS_NULL ) {
143- auto resolved = ResolveColumn (*op_expr.children [0 ], column_path, arrow_type);
145+ auto resolved = ResolveColumn (*op_expr.GetChildren () [0 ], column_path, arrow_type);
144146 auto col = backend.MakeColumnRef (resolved.path );
145147 return backend.IsNull (std::move (col));
146148 }
147149 if (expression_type == ExpressionType::OPERATOR_IS_NOT_NULL ) {
148- auto resolved = ResolveColumn (*op_expr.children [0 ], column_path, arrow_type);
150+ auto resolved = ResolveColumn (*op_expr.GetChildren () [0 ], column_path, arrow_type);
149151 auto col = backend.MakeColumnRef (resolved.path );
150152 return backend.IsNotNull (std::move (col));
151153 }
152154 if (expression_type == ExpressionType::COMPARE_IN ) {
153- auto resolved = ResolveColumn (*op_expr.children [0 ], column_path, arrow_type);
155+ auto resolved = ResolveColumn (*op_expr.GetChildren () [0 ], column_path, arrow_type);
154156 auto col = backend.MakeColumnRef (resolved.path );
155157 vector<Value> values;
156- for (idx_t i = 1 ; i < op_expr.children .size (); i++) {
157- auto &const_expr = op_expr.children [i]->Cast <BoundConstantExpression>();
158- values.push_back (const_expr.value );
158+ for (idx_t i = 1 ; i < op_expr.GetChildren () .size (); i++) {
159+ auto &const_expr = op_expr.GetChildren () [i]->Cast <BoundConstantExpression>();
160+ values.push_back (const_expr.GetValue () );
159161 }
160- auto col_type = op_expr.children [0 ]->GetReturnType ();
162+ auto col_type = op_expr.GetChildren () [0 ]->GetReturnType ();
161163 return backend.IsIn (std::move (col), values, col_type, timezone_config);
162164 }
163165 }
@@ -167,9 +169,9 @@ py::object TransformExpression(const Expression &expression, const vector<string
167169 const bool is_and = expression_type == ExpressionType::CONJUNCTION_AND ;
168170 auto &conj_expr = expression.Cast <BoundConjunctionExpression>();
169171 py::object result = py::none ();
170- for (idx_t i = 0 ; i < conj_expr.children .size (); i++) {
172+ for (idx_t i = 0 ; i < conj_expr.GetChildren () .size (); i++) {
171173 py::object child_expression =
172- TransformExpression (*conj_expr.children [i], column_path, backend, arrow_type, timezone_config);
174+ TransformExpression (*conj_expr.GetChildren () [i], column_path, backend, arrow_type, timezone_config);
173175 if (child_expression.is (py::none ())) {
174176 if (is_and) {
175177 // A conjunct we can't push can simply be dropped: the remaining AND
@@ -198,7 +200,7 @@ py::object TransformExpression(const Expression &expression, const vector<string
198200 ExpressionClassToString (expression_class));
199201}
200202
201- py::object TransformFilter (const TableFilter &filter, vector<string> column_path, FilterBackend &backend,
203+ py::object TransformFilter (const TableFilter &filter, const vector<Identifier> & column_path, FilterBackend &backend,
202204 const ArrowType *arrow_type, const string &timezone_config) {
203205 switch (filter.filter_type ) {
204206 case TableFilterType::EXPRESSION_FILTER : {
0 commit comments