diff --git a/duckpgq/include/duckpgq/functions/tablefunctions/match.hpp b/duckpgq/include/duckpgq/functions/tablefunctions/match.hpp index ea728959..c2f050e8 100644 --- a/duckpgq/include/duckpgq/functions/tablefunctions/match.hpp +++ b/duckpgq/include/duckpgq/functions/tablefunctions/match.hpp @@ -68,8 +68,7 @@ struct PGQMatchFunction : public TableFunction { const string &prev_binding, const string &next_binding, vector> &conditions, - unique_ptr &from_clause, - const vector> &column_list); + unique_ptr &from_clause); static void EdgeTypeLeft(const shared_ptr &edge_table, const string &next_table_name, @@ -130,8 +129,7 @@ struct PGQMatchFunction : public TableFunction { vector> &conditions, unordered_map &alias_map, int32_t &extra_alias_counter, - unique_ptr &from_clause, - vector> &column_list); + unique_ptr &from_clause); static void ProcessPathList( vector> &path_pattern, diff --git a/duckpgq/src/duckpgq/functions/tablefunctions/match.cpp b/duckpgq/src/duckpgq/functions/tablefunctions/match.cpp index 883ba9ec..cd93baef 100644 --- a/duckpgq/src/duckpgq/functions/tablefunctions/match.cpp +++ b/duckpgq/src/duckpgq/functions/tablefunctions/match.cpp @@ -367,18 +367,8 @@ void PGQMatchFunction::EdgeTypeAny( const string &edge_binding, const string &prev_binding, const string &next_binding, vector> &conditions, - unique_ptr &from_clause, - const vector> &column_list) { - vector> edge_columns; - for (const auto& expr : column_list) { - const auto column_expr = dynamic_cast(expr.get()); - if (column_expr == nullptr) { - continue; - } - if (column_expr->column_names[0] == edge_binding) { - edge_columns.push_back(make_uniq(column_expr->column_names[1], edge_table->table_name)); - } - } + unique_ptr &from_clause) { + // START SELECT src, dst, * from edge_table auto src_dst_select_node = make_uniq(); @@ -647,14 +637,14 @@ void PGQMatchFunction::AddEdgeJoins(const shared_ptr &edge_t const string &prev_binding, const string &next_binding, vector> &conditions, unordered_map &alias_map, int32_t &extra_alias_counter, - unique_ptr &from_clause, vector> &column_list) { + unique_ptr &from_clause) { if (edge_type != PGQMatchType::MATCH_EDGE_ANY) { alias_map[edge_binding] = edge_table->table_name; } switch (edge_type) { case PGQMatchType::MATCH_EDGE_ANY: { EdgeTypeAny(edge_table, edge_binding, prev_binding, next_binding, - conditions, from_clause, column_list); + conditions, from_clause); break; } case PGQMatchType::MATCH_EDGE_LEFT: @@ -919,7 +909,7 @@ void PGQMatchFunction::ProcessPathList( edge_element->variable_binding, previous_vertex_element->variable_binding, next_vertex_element->variable_binding, conditions, - alias_map, extra_alias_counter, from_clause, column_list); + alias_map, extra_alias_counter, from_clause); } } else { // The edge element is a path element without WHERE or path-finding. @@ -931,7 +921,7 @@ void PGQMatchFunction::ProcessPathList( edge_element->variable_binding, previous_vertex_element->variable_binding, next_vertex_element->variable_binding, conditions, - alias_map, extra_alias_counter, from_clause, column_list); + alias_map, extra_alias_counter, from_clause); // Check the edge type // If (a)-[b]->(c) -> b.src = a.id AND b.dst = c.id // If (a)<-[b]-(c) -> b.dst = a.id AND b.src = c.id