message: Cleanup transform_cte.cpp
diff: @@ -13,16 +13,11 @@ void Transformer::TransformCTE(PGWithClause *de_with_clause, SelectStatement &se
  // TODO: might need to update in case of future lawsuit
  assert(de_with_clause);
  -// if (de_with_clause->recursive) {
  -// throw NotImplementedException("Recursive CTEs not supported");
  -// }
  assert(de_with_clause->ctes);
  for (auto cte_ele = de_with_clause->ctes->head; cte_ele != NULL; cte_ele = cte_ele->next) {
  auto cte = reinterpret_cast<PGCommonTableExpr *>(cte_ele->data.ptr_value);
  // lets throw some errors on unsupported features early
  -// if (cte->cterecursive) {
  -// throw NotImplementedException("Recursive CTEs not supported");
  -// }
  +
  if (cte->aliascolnames) {
  throw NotImplementedException("Column name aliases not supported in CTEs");
  }
  @@ -43,9 +38,9 @@ void Transformer::TransformCTE(PGWithClause *de_with_clause, SelectStatement &se
  throw Exception("A CTE needs a SELECT");
  }
  -// auto cte_select = TransformSelectNode((PGSelectStmt *)cte->ctequery);
  unique_ptr<QueryNode> cte_select;
  + // CTE transformation can either result in inlining for non recursive CTEs, or in recursive CTE bindings otherwise.
  if(cte->cterecursive || de_with_clause->recursive) {
  cte_select = TransformRecursiveCTE(cte);
  } else {
  @@ -86,7 +81,7 @@ unique_ptr<QueryNode> Transformer::TransformRecursiveCTE(PGCommonTableExpr *cte)
  result->right = TransformSelectNode(stmt->rarg);
  if (!result->left || !result->right) {
  - throw Exception("Failed to transform setop children.");
  + throw Exception("Failed to transform recursive CTE children.");
  }
  result->select_distinct = true;
  @@ -95,7 +90,7 @@ unique_ptr<QueryNode> Transformer::TransformRecursiveCTE(PGCommonTableExpr *cte)
  result->select_distinct = !stmt->all;
  break;
  default:
  - throw Exception("Unexpected setop type");
  + throw Exception("Unexpected setop type for recursive CTE");
  }
  // if we compute the distinct result here, we do not have to do this in
  // the children. This saves a bunch of unnecessary DISTINCTs.
  