Open vikramsubramanian opened 4 months ago
but here are some ideas that might help you get started -
Summary: Feature request to add the ability to alter REL TABLE GROUP
with FROM ... TO ...
statement for adding additional node table pairs after the creation of the relationship table.
To implement the feature request for ALTER REL TABLE GROUP
with FROM ... TO ...
statement to alter database schema, follow these steps:
Extend the parser to recognize the new ALTER REL TABLE GROUP
syntax with FROM ... TO ...
clauses.
ALTER REL TABLE GROUP
.CypherParser::kU_AlterTableContext
and related parsing functions to handle the new syntax.Update the Transformer
class to transform the new ALTER REL TABLE GROUP
syntax into an internal representation.
Transformer
to handle the transformation of the new ALTER REL TABLE GROUP
syntax.AlterRelTableGroupAdd
and AlterRelTableGroupDrop
statements or similar, depending on the operation.Implement the execution logic for the new ALTER REL TABLE GROUP
operations.
AlterRelTableGroupAdd
and AlterRelTableGroupDrop
, that inherit from a base DDL operation class.executeDDLInternal
method in these classes to perform the necessary schema changes.Update the RelTableGroupSchema
class to support adding and removing node table pairs.
RelTableGroupSchema
for adding and removing relationships between tables.Ensure that the new ALTER REL TABLE GROUP
operations are correctly logged for durability and recovery.
Update the test suite to include tests for the new ALTER REL TABLE GROUP
functionality.
test/ddl/e2e_ddl_test.cpp
to verify that the new ALTER REL TABLE GROUP
operations work as expected.Handle permissions and user-generated content.
ALTER REL TABLE GROUP
operations.Update documentation to reflect the new feature and provide examples of usage.
Remember to follow the existing codebase's style and architecture when implementing these changes.
src/parser/transform/transform_ddl.cpp
This file contains the logic for transforming DDL statements, including the creation of relationship table groups. Since the issue requests an ALTER statement for REL TABLE GROUP, this file is likely to be modified to include the new functionality.
src/processor/operator/ddl/create_rel_table_group.cpp
This file contains the execution logic for creating relationship table groups. It is relevant because the issue involves altering the REL TABLE GROUP, which may require changes to the creation logic or the addition of new logic for the ALTER statement.
third_party/antlr4_cypher/cypher_parser.cpp
This file is part of the parser and may need to be updated to recognize the new ALTER REL TABLE GROUP syntax.
It would be nice, if we could add additional node table pairs via
FROM ... TO
after creation of aREL TABLE GROUP
relationship table. For example you need to alter database schema in the course of app progress. Or imagine an app, that allows structured, user-generated content via some kind of plugin system. This requires users to create additional tables. These tables might need to have relations to other tables. Some of these relations might have been instantiated viaREL TABLE GROUP
. Vice versa, same goes forDROP
. Currently there is noALTER
in combination with manipulation ofFROM ... TO
afterwards. At least I couldn't find it in below resources:)