Skip to content

fix: schema.cypher rel and output_dir naming - #15

Merged
adsharma merged 2 commits into
mainfrom
fix/cli-output-and-schema-names
Aug 17, 2026
Merged

fix: schema.cypher rel and output_dir naming#15
adsharma merged 2 commits into
mainfrom
fix/cli-output-and-schema-names

Conversation

@adsharma

Copy link
Copy Markdown
Collaborator

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:

CREATE NODE TABLE graph500_24(id INT64, PRIMARY KEY(id)) WITH (storage = './tmp', format = 'icebug-disk');
CREATE REL TABLE graph500_24(FROM graph500_24 TO graph500_24) WITH (storage = './tmp', format = 'icebug-disk');

The REL table is now named <graph>_rel, so NODE and REL catalog names never collide:

CREATE REL TABLE graph500_24_rel(FROM graph500_24 TO graph500_24, weight DOUBLE) ...

2. output_dboutput_dir

convert_parquet_dir_to_csr had no DuckDB involvement — the output_db path was only a naming convention. It is replaced with output_dir:

  • Default output is now <source_dir>-csr (e.g. graph500-24/graph500-24-csr/)
  • Multi-graph sources write <output_dir>/<graph_name>/
  • New --output-dir CLI flag for --source-dir; --output-db remains for the DuckDB/GraphAr paths
  • Default storage recorded in schema.cypher derives from the output dir name

Test plan

  • uv run pytest: 109 passed
  • Manual CLI run on a graph500-24 source dir: output lands in graph500-24-csr/ with a valid schema.cypher

- 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)
@adsharma adsharma changed the title fix: schema.cypher rel naming and replace output_db with output_dir fix: schema.cypher rel and output_dir naming Aug 17, 2026
@adsharma
adsharma merged commit e84ab14 into main Aug 17, 2026
1 check passed
@adsharma
adsharma deleted the fix/cli-output-and-schema-names branch August 17, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant