321907 {
321908
321909 if ((op.type != LogicalOperatorType::LOGICAL_FILTER && op.type != LogicalOperatorType::LOGICAL_ANY_JOIN) ||
321910 !is_root) {
321911 return nullptr;
321912 }
321913
321914
321915 if (!ExpressionIsDisjunction(bindings[0])) {
321916 return nullptr;
321917 }
321918
321919 ColumnBinding column_binding;
321920 if (GetSingleColumnBinding(bindings[0], column_binding)) {
321921 return nullptr;
321922 }
321923
321924
321925 const auto binding_map = GetDisjunctedPredicateMap(bindings[0].
get());
321926 if (binding_map.empty()) {
321927 return nullptr;
321928 }
321929
321930 unique_ptr<Expression> derived_filter;
321931 for (auto &entry : binding_map) {
321932 D_ASSERT(!entry.second.empty());
321933
321934
321935 unique_ptr<Expression> column_filter;
321936 for (auto &expr : entry.second) {
321937 if (!column_filter) {
321938 column_filter = expr.get().Copy();
321939 } else {
321940 auto new_disjunction = make_uniq<BoundConjunctionExpression>(ExpressionType::CONJUNCTION_OR);
321941 new_disjunction->children.push_back(std::move(column_filter));
321942 new_disjunction->children.push_back(expr.get().Copy());
321943 column_filter = std::move(new_disjunction);
321944 }
321945 }
321946
321947
321948 if (!derived_filter) {
321949 derived_filter = std::move(column_filter);
321950 } else {
321951 auto new_conjunction = make_uniq<BoundConjunctionExpression>(ExpressionType::CONJUNCTION_AND);
321952 new_conjunction->children.push_back(std::move(column_filter));
321953 new_conjunction->children.push_back(std::move(derived_filter));
321954 derived_filter = std::move(new_conjunction);
321955 }
321956 }
321957
321958
321959 auto result = make_uniq<BoundConjunctionExpression>(ExpressionType::CONJUNCTION_AND);
321960 result->children.push_back(bindings[0].
get().Copy());
321961 result->children.push_back(std::move(derived_filter));
321962 return std::move(result);
321963}
__host__ cudaTextureObject_t get() const noexcept