message: Hack to wrap COUNT aggregates in CASE
diff: #include "planner/operator/list.hpp"
  #include "planner/subquery/has_correlated_expressions.hpp"
  #include "planner/subquery/rewrite_correlated_expressions.hpp"
  +#include "planner/expression/bound_aggregate_expression.hpp"
  +#include "catalog/catalog_entry/aggregate_function_catalog_entry.hpp"
  using namespace duckdb;
  using namespace std;
  @@ -132,8 +134,9 @@ unique_ptr<LogicalOperator> FlattenDependentJoins::PushDownDependentJoinInternal
  // ELSE COUNT(*) END
  for (index_t i = 0; i < aggr.expressions.size(); i++) {
  assert(aggr.expressions[i]->GetExpressionClass() == ExpressionClass::BOUND_AGGREGATE);
  - if (aggr.expressions[i]->type == ExpressionType::AGGREGATE_COUNT ||
  - aggr.expressions[i]->type == ExpressionType::AGGREGATE_COUNT_STAR ) {
  + auto bound = (BoundAggregateExpression*) &*aggr.expressions[i];
  + vector<SQLType> arguments;
  + if (!bound->bound_aggregate->cast_arguments(arguments)) {
  // have to replace this ColumnBinding with the CASE expression
  replacement_map[ColumnBinding(aggr.aggregate_index, i)] = i;
  }
  