@@ -11,7 +11,13 @@ string PostgresFilterPushdown::CreateExpression(string &column_name, vector<uniq
11
11
string op) {
12
12
vector<string> filter_entries;
13
13
for (auto &filter : filters) {
14
- filter_entries.push_back (TransformFilter (column_name, *filter));
14
+ auto filter_str = TransformFilter (column_name, *filter);
15
+ if (!filter_str.empty ()) {
16
+ filter_entries.push_back (std::move (filter_str));
17
+ }
18
+ }
19
+ if (filter_entries.empty ()) {
20
+ return string ();
15
21
}
16
22
return " (" + StringUtil::Join (filter_entries, " " + op + " " ) + " )" ;
17
23
}
@@ -98,6 +104,8 @@ string PostgresFilterPushdown::TransformFilter(string &column_name, TableFilter
98
104
}
99
105
return column_name + " IN (" + in_list + " )" ;
100
106
}
107
+ case TableFilterType::DYNAMIC_FILTER:
108
+ return string ();
101
109
default :
102
110
throw InternalException (" Unsupported table filter type" );
103
111
}
@@ -111,13 +119,17 @@ string PostgresFilterPushdown::TransformFilters(const vector<column_t> &column_i
111
119
}
112
120
string result;
113
121
for (auto &entry : filters->filters ) {
114
- if (!result.empty ()) {
115
- result += " AND " ;
116
- }
117
122
auto column_name = KeywordHelper::WriteQuoted (names[column_ids[entry.first ]], ' "' );
118
123
auto &filter = *entry.second ;
124
+ auto filter_text = TransformFilter (column_name, filter);
119
125
120
- result += TransformFilter (column_name, filter);
126
+ if (filter_text.empty ()) {
127
+ continue ;
128
+ }
129
+ if (!result.empty ()) {
130
+ result += " AND " ;
131
+ }
132
+ result += filter_text;
121
133
}
122
134
return result;
123
135
}
0 commit comments