Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify output for table_info command in rel table #2991

Closed
prrao87 opened this issue Mar 4, 2024 · 3 comments · Fixed by #3372
Closed

Modify output for table_info command in rel table #2991

prrao87 opened this issue Mar 4, 2024 · 3 comments · Fixed by #3372
Assignees
Labels
good-warm-up Good warm up feature usability Issues related to better usability experience, including bad error messages

Comments

@prrao87
Copy link
Member

prrao87 commented Mar 4, 2024

Currently, we need to run 3 CALL statements to retrieve the primary key info from the node tables so that we know how to construct the correct export query for the rel table.

CALL table_info(Node1)
RETURN *;

CALL table_info(Node2)
RETURN *;

CALL table_info(Rel)
RETURN *;

The first two show us the primary keys for the node tables. Simply exporting the rel table with all properties of the node table (or skipping the node tables entirely) isn't useful.

Current

When we output the table info for a rel table, it only outputs the relationship properties, but no node primary key info (which would be helpful to output the rel table).

kuzu> CALL table_info("Rel") RETURN *;
--------------------------------------------
| property id | name           | type      |
--------------------------------------------
| 1           | id | INT64     |
--------------------------------------------
| 2           | example_prop     | STRING     |
--------------------------------------------

Desired

We could output the src and dest primary keys from the underlying rel table information.

kuzu> CALL table_info("Rel") RETURN *;
--------------------------------------------
| property id | name           | type      |
--------------------------------------------
| 1           | id | INT64     |
--------------------------------------------
| 2           | example_prop     | STRING     |
--------------------------------------------

src: Node1, primary_key: id
dest: Node2, primary_ley: id

This would allow the user to obtain just enough information via a single CALL statement to output the rel table with the node primary keys via a subsequent COPY TO command.

@prrao87 prrao87 added the usability Issues related to better usability experience, including bad error messages label Mar 4, 2024
@semihsalihoglu-uw semihsalihoglu-uw added the good-warm-up Good warm up feature label Mar 4, 2024
@semihsalihoglu-uw
Copy link
Contributor

Consider assigning this to @manh9203 @mxwli or @MSebanc as well during times they need an issue to take care of.

@manh9203
Copy link
Contributor

@prrao87 I found it's tricky to fit these information into the result of table_info, or maintain them outside the result, so I modified show_connection to display them instead.
Now we can get information for exporting rel table using 2 queries:

  • CALL show_connection('rel_table') to get the name of nodes and their primary key
  • CALL table_info('rel_table') to get the name of the table's properties

@prrao87
Copy link
Member Author

prrao87 commented Apr 24, 2024

Ok, will document this accordingly (after I test).

@prrao87 prrao87 mentioned this issue Apr 24, 2024
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-warm-up Good warm up feature usability Issues related to better usability experience, including bad error messages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants