Skip to content

Commit

Permalink
Simplified logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Dec 8, 2023
1 parent 24884e0 commit f484fe0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ struct CreatePropertyGraphInfo : public CreateInfo {
//! Dictionary to point label to vector or edge table
case_insensitive_map_t<shared_ptr<PropertyGraphTable>> label_map;

case_insensitive_map_t<string> table_alias_map;

public:
unique_ptr<CreateInfo> Copy() const override;

Expand Down
3 changes: 0 additions & 3 deletions src/parser/parsed_data/create_property_graph_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ unique_ptr<CreateInfo> CreatePropertyGraphInfo::Copy() const {
result->label_map[copied_edge_table->main_label] = copied_edge_table;
result->edge_tables.push_back(std::move(copied_edge_table));
}
result->table_alias_map.insert(table_alias_map.begin(), table_alias_map.end());
return std::move(result);
}

Expand All @@ -49,7 +48,6 @@ void CreatePropertyGraphInfo::Serialize(Serializer &serializer) const {
list.WriteObject([&](Serializer &obj) { entry->Serialize(obj); });
});
serializer.WriteProperty(103, "label_map", label_map);
serializer.WriteProperty(104, "table_alias_map", table_alias_map);
}

unique_ptr<CreateInfo> CreatePropertyGraphInfo::Deserialize(Deserializer &deserializer) {
Expand All @@ -63,7 +61,6 @@ unique_ptr<CreateInfo> CreatePropertyGraphInfo::Deserialize(Deserializer &deseri
});

deserializer.ReadProperty(103, "label_map", result->label_map);
deserializer.ReadProperty(104, "table_alias_map", result->table_alias_map);
return std::move(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Transformer::TransformCreatePropertyGraph(duckdb_libpgquery::PGCreatePropertyGra
auto info = make_uniq<CreatePropertyGraphInfo>();

case_insensitive_set_t global_label_set;

case_insensitive_map_t<string> table_alias_map;
auto property_graph_name = TransformQualifiedName(*stmt.name);
info->property_graph_name = property_graph_name.name;

Expand All @@ -141,7 +141,7 @@ Transformer::TransformCreatePropertyGraph(duckdb_libpgquery::PGCreatePropertyGra
throw NotImplementedException("CreatePropertyGraphTable not implemented.");
}
auto graph_table = reinterpret_cast<duckdb_libpgquery::PGPropertyGraphTable *>(vertex_table->data.ptr_value);
auto pg_table = TransformPropertyGraphTable(graph_table, global_label_set, info->table_alias_map);
auto pg_table = TransformPropertyGraphTable(graph_table, global_label_set, table_alias_map);
for (auto &label : pg_table->sub_labels) {
info->label_map[label] = pg_table;
}
Expand All @@ -158,7 +158,7 @@ Transformer::TransformCreatePropertyGraph(duckdb_libpgquery::PGCreatePropertyGra
throw NotImplementedException("CreatePropertyGraphTable not implemented.");
}
auto graph_table = reinterpret_cast<duckdb_libpgquery::PGPropertyGraphTable *>(edge_table->data.ptr_value);
auto pg_table = TransformPropertyGraphTable(graph_table, global_label_set, info->table_alias_map);
auto pg_table = TransformPropertyGraphTable(graph_table, global_label_set, table_alias_map);
for (auto &label : pg_table->sub_labels) {
info->label_map[label] = pg_table;
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/transform/tableref/transform_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ unique_ptr<SubPath> Transformer::TransformSubPathElement(duckdb_libpgquery::PGSu

result->where_clause = TransformExpression(root->where_clause);
if (root->lower > root->upper) {
throw ConstraintException("lower bound greater than upper bound");
throw ConstraintException("Lower bound greater than upper bound");
}
result->lower = root->lower;
result->upper = root->upper;
Expand Down

0 comments on commit f484fe0

Please sign in to comment.