2222#include " common/ducklake_encryption.hpp"
2323#include " common/ducklake_options.hpp"
2424#include " common/index.hpp"
25+ #include " duckdb/planner/filter/expression_filter.hpp"
2526#include " duckdb/planner/table_filter.hpp"
2627
2728namespace duckdb {
@@ -33,7 +34,6 @@ class DuckLakeTransaction;
3334class BoundAtClause ;
3435class QueryResult ;
3536class FileSystem ;
36- class ConstantFilter ;
3737
3838struct SnapshotAndStats ;
3939struct FlushedInlinedTableInfo ;
@@ -62,16 +62,27 @@ struct FilterSQLResult {
6262struct ColumnFilterInfo {
6363 idx_t column_field_index;
6464 LogicalType column_type;
65- unique_ptr<TableFilter > table_filter;
65+ unique_ptr<ExpressionFilter > table_filter;
6666
67- ColumnFilterInfo (idx_t col_idx, LogicalType type, unique_ptr<TableFilter > filter)
67+ ColumnFilterInfo (idx_t col_idx, LogicalType type, unique_ptr<ExpressionFilter > filter)
6868 : column_field_index(col_idx), column_type(std::move(type)), table_filter(std::move(filter)) {
6969 }
7070
7171 ColumnFilterInfo (const ColumnFilterInfo &other)
7272 : column_field_index(other.column_field_index), column_type(other.column_type),
7373 table_filter (other.table_filter->Copy ()) {
7474 }
75+
76+ ColumnFilterInfo (ColumnFilterInfo &&other) = default;
77+ ColumnFilterInfo &operator =(ColumnFilterInfo &&other) = default;
78+ ColumnFilterInfo &operator =(const ColumnFilterInfo &other) {
79+ if (this != &other) {
80+ column_field_index = other.column_field_index ;
81+ column_type = other.column_type ;
82+ table_filter = other.table_filter ? other.table_filter ->Copy () : nullptr ;
83+ }
84+ return *this ;
85+ }
7586};
7687
7788struct FilterPushdownInfo {
@@ -321,16 +332,19 @@ class DuckLakeMetadataManager {
321332 virtual FilterSQLResult ConvertFilterPushdownToSQL (const FilterPushdownInfo &filter_info);
322333 virtual string GenerateCTESectionFromRequirements (const unordered_map<idx_t , CTERequirement> &requirements,
323334 TableIndex table_id);
324- virtual string GenerateFilterFromTableFilter (const TableFilter &filter, const LogicalType &type,
335+ virtual string GenerateFilterFromTableFilter (const ExpressionFilter &filter, const LogicalType &type,
325336 unordered_set<string> &referenced_stats);
337+ virtual string GenerateFilterFromExpression (const Expression &expr, const LogicalType *type,
338+ unordered_set<string> &referenced_stats);
326339 virtual bool ValueIsFinite (const Value &val);
327340 virtual string CastValueToTarget (const Value &val, const LogicalType &type);
328341 virtual string CastStatsToTarget (const string &stats, const LogicalType &type);
329- virtual string GenerateConstantFilter (const ConstantFilter &constant_filter , const LogicalType &type,
342+ virtual string GenerateConstantFilter (ExpressionType comparison_type, const Value &constant , const LogicalType &type,
330343 unordered_set<string> &referenced_stats);
331- virtual string GenerateConstantFilterDouble (const ConstantFilter &constant_filter, const LogicalType &type,
344+ virtual string GenerateConstantFilterDouble (ExpressionType comparison_type, const Value &constant,
345+ const LogicalType &type,
332346 unordered_set<string> &referenced_stats);
333- virtual string GenerateFilterPushdown (const TableFilter &filter, unordered_set<string> &referenced_stats);
347+ virtual string GenerateFilterPushdown (const ExpressionFilter &filter, unordered_set<string> &referenced_stats);
334348
335349public:
336350 // ! Read inlined file deletions for regular table scans (no snapshot info per row)
0 commit comments