Auto creates vertex or edge label on agload
Changes made in order to reduce redundancy on calling load_edges_from_file and load_labels_from_file, so calling create_vlabel and create_elabel before loading a csv file is not needed anymore.
Updated regression tests.
BEFORE:
SELECT create_vlabel('agload_test_graph','City');
NOTICE: VLabel "City" has been created
create_vlabel
---------------
(1 row)
SELECT load_labels_from_file('agload_test_graph', 'City',
'age_load/cities.csv');
load_labels_from_file
-----------------------
(1 row)
SELECT create_elabel('agload_test_graph','has_city');
NOTICE: ELabel "has_city" has been created
create_elabel
---------------
(1 row)
SELECT load_edges_from_file('agload_test_graph', 'has_city',
'age_load/edges.csv');
load_edges_from_file
----------------------
(1 row)
AFTER:
SELECT load_labels_from_file('agload_test_graph', 'City',
'age_load/cities.csv');
NOTICE: VLabel "City" has been created
load_labels_from_file
-----------------------
(1 row)
SELECT load_edges_from_file('agload_test_graph', 'has_city',
'age_load/edges.csv');
NOTICE: ELabel "has_city" has been created
load_edges_from_file
----------------------
(1 row)
Should we check if the label already exists before making the DirectFunctionCall? And, add tests for this case?
Sure thing, I'll do it now.
I have added a second load on the same file for the tests, so it will add vertexes and edges twice on the same labels, and it won't throw an error message.
Please let me know if this is alright.
@markgomer
Looks good to me.
One thing that concerns me is that the agload test is taking way longer than other tests since it is now loading the csv files many times. So, I looked at the tests you added to see if we can remove some of them. For the sake of speeding the test, otherwise they were fine.
Should we remove these two groups of tests?
- Tests without creating labels first, without id field
- TEST DOUBLE LOAD files
My justification is- the changes you made does not affect the algorithm of 'without id field' and 'double load' directly. So it may be okay to not tests these functionalities at least in this PR. Your changes are well tested by the first group of tests you added, where you check if the label was actually created and the number of rows in the labels using the COUNT function.
@rafsun42 I removed the tests you mentioned and the white spaces. So for this PR, only the "Tests without creating labels first, with id field" are added.
This PR is stale because it has been open 45 days with no activity. Remove "Abondoned" label or comment or this will be closed in 7 days.
@markgomer @rafsun42 Is there any specific reason this patch was not merged?
Hello @MuhammadTahaNaveed, I'll work on resolving the conflicts that appeared after the updates soon. I'm not sure why it wasn't merged though.
@markgomer Just checking if there is an update,...
@jrgemignani I'm running into some problems, the tests are failing after rebasing. I may have missed something along the way. I am using PostgreSQL 16beta2 with Apache AGE master branch, does this work or should I install another version?
@markgomer I build with 16.2 against the master without issue. The PR is complaining about -
Maybe there are some Github merge conflict markers (>>>>>>>, <<<<<<<) in the file?
This PR is stale because it has been open 60 days with no activity. Remove "Abondoned" label or comment or this will be closed in 14 days.
This PR was closed because it has been stalled for further 14 days with no activity