fix: schema.cypher rel and output_dir naming - #15
Merged
Conversation
- Name REL tables <graph>_rel so NODE and REL table names never clash in generated schema.cypher (previously both were <graph>, which is invalid) - Rename convert_parquet_dir_to_csr output_db -> output_dir: there is no DuckDB in this path; output Parquet now defaults to <source_dir>-csr - Add --output-dir CLI flag for --source-dir conversions, keeping --output-db for the DuckDB/GraphAr paths - Default schema.cypher storage path derives from the output dir name - Update bench scripts and tests for the renamed parameter
LadybugDB derives parquet filenames from the schema table names (nodes_<name>.parquet, indices_<rel>.parquet, indptr_<rel>.parquet). The REL table was renamed to <name>_rel to avoid clashing with the NODE table, but the parquet writers still emitted indices_<name>.parquet, so lbug could not open the rel table files. - Rename rel parquet files to indices_<name>_rel.parquet / indptr_<name>_rel.parquet in all three backends, sharing one csr_rel_name() helper in convert_parquet - cli.py: hoist get_edge_display_name() to module level and export indices_<rel_name>.parquet / indptr_<rel_name>.parquet so the DuckDB path stays in sync for unprefixed edge tables too - Update tests to read the _rel files; verified end-to-end with lbug (schema loads, MATCH query returns the expected edge count)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two fixes for the vertex/edge Parquet → icebug-disk conversion path.
1. Valid
schema.cypher(NODE/REL name clash)Previously the generated schema used the same table name for both the NODE and REL table:
The REL table is now named
<graph>_rel, so NODE and REL catalog names never collide:2.
output_db→output_dirconvert_parquet_dir_to_csrhad no DuckDB involvement — theoutput_dbpath was only a naming convention. It is replaced withoutput_dir:<source_dir>-csr(e.g.graph500-24/→graph500-24-csr/)<output_dir>/<graph_name>/--output-dirCLI flag for--source-dir;--output-dbremains for the DuckDB/GraphAr pathsstoragerecorded inschema.cypherderives from the output dir nameTest plan
uv run pytest: 109 passedgraph500-24source dir: output lands ingraph500-24-csr/with a valid schema.cypher