age icon indicating copy to clipboard operation
age copied to clipboard

Auto creates vertex or edge label on agload

Open markgomer opened this issue 2 years ago • 11 comments

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)

markgomer avatar Aug 23 '23 14:08 markgomer

Should we check if the label already exists before making the DirectFunctionCall? And, add tests for this case?

rafsun42 avatar Sep 07 '23 19:09 rafsun42

Sure thing, I'll do it now.

markgomer avatar Sep 09 '23 13:09 markgomer

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 avatar Sep 09 '23 14:09 markgomer

@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 avatar Oct 31 '23 16:10 rafsun42

@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.

markgomer avatar Nov 01 '23 14:11 markgomer

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.

github-actions[bot] avatar May 11 '24 00:05 github-actions[bot]

@markgomer @rafsun42 Is there any specific reason this patch was not merged?

MuhammadTahaNaveed avatar May 11 '24 14:05 MuhammadTahaNaveed

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 avatar May 13 '24 12:05 markgomer

@markgomer Just checking if there is an update,...

jrgemignani avatar May 23 '24 22:05 jrgemignani

@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 avatar May 24 '24 13:05 markgomer

@markgomer I build with 16.2 against the master without issue. The PR is complaining about -

image

Maybe there are some Github merge conflict markers (>>>>>>>, <<<<<<<) in the file?

jrgemignani avatar May 24 '24 17:05 jrgemignani

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.

github-actions[bot] avatar Jul 24 '24 00:07 github-actions[bot]

This PR was closed because it has been stalled for further 14 days with no activity

github-actions[bot] avatar Aug 08 '24 00:08 github-actions[bot]