Skip to content

update to icebug-disk v1 - #3

Merged
adsharma merged 5 commits into
Ladybug-Memory:mainfrom
aheev:update-icebug-disk
May 25, 2026
Merged

update to icebug-disk v1#3
adsharma merged 5 commits into
Ladybug-Memory:mainfrom
aheev:update-icebug-disk

Conversation

@aheev

@aheev aheev commented May 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@aheev

aheev commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

@adsharma

  • do we need generators(generate/*.py) at all?
  • should we follow a more general approach to input tables? something like a config file with (ofc we need to tidy it up)
"node_table_files" : [
"nt1" : "node_table1.parquet",
"nt2" :  "node_table2.parquet",
 ... ]
"rel_table_files" : [
                             "rel_table1" : ["from_table_name", "to_table_name", "from_col", "to_col", "rel_table.parquet"],
                             "rel_table2" : [...],
 ... 
]

so that users can just bring their parquet files without modifying source tables

@adsharma

Copy link
Copy Markdown
Collaborator

ok to get rid of generate/*.py in a separate PR

Leaning towards convention over configuration ruby style. If someone brings a directory full of parquet files we could add some scripts that rename/generate the schema.cypher instead of requiring them to read docs and write such a config file.

@aheev aheev mentioned this pull request May 24, 2026
@adsharma

Copy link
Copy Markdown
Collaborator

What was the motivation for removing the node table entry from schema.cypher? Because they're not explicitly used?
Without the node table, the rel table entry becomes semantically invalid cypher.

The main reason why they're there is to help the icebug-format cli to understand acceptable node types for rel tables. Also important for multi rel tables IIRC.

@aheev

aheev commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

What was the motivation for removing the node table entry from schema.cypher? Because they're not explicitly used? Without the node table, the rel table entry becomes semantically invalid cypher.

The main reason why they're there is to help the icebug-format cli to understand acceptable node types for rel tables. Also important for multi rel tables IIRC.

CLI is not treating it as cypher

content = schema_path.read_text()

# Parse REL TABLE definitions: CREATE REL TABLE Follows(FROM User TO User, ...);
# Also handles backtick-quoted identifiers: CREATE REL TABLE `edges` (FROM `nodes` TO `nodes`, ...)
rel_pattern = (
  r"CREATE\s+REL\s+TABLE\s+`?(\w+)`?\s*\(\s*FROM\s+`?(\w+)`?\s+TO\s+`?(\w+)`?"
)
for match in re.finditer(rel_pattern, content, re.IGNORECASE):
  edge_name = match.group(1).lower()
  from_node = match.group(2).lower()
  to_node = match.group(3).lower()
  edge_relationships[edge_name] = (from_node, to_node)

@adsharma

Copy link
Copy Markdown
Collaborator

That was a practical compromise to avoid linking a ladybug cypher parser into icebug-format cli.

Generating output schema.cypher without the node table definition will require parsing parquet and converting types.

@adsharma

Copy link
Copy Markdown
Collaborator

Looks good. Two minor nits:

  • ladybug >= 0.17.0 won't work until its released. 0.17.0.dev20260522 < 0.17.0 in some versioning schemes
  • examples/karate/duckdb/icebug-disk could move to examples/karate/icebug-disk/

Ideal invocation:

uv run icebug-format.py --source-db kg_history.duckdb --schema schema.cypher

and it could infer:

 --output-db kg_history_csr.duckdb --csr-table kg_history

from --source-db. Remove the hard coded defaults

  --source-db SOURCE_DB
                       Source DuckDB database path (default: karate_random.duckdb)
 --output-db OUTPUT_DB
                       Output DuckDB database path (default: csr_graph.db)
 --csr-table CSR_TABLE
                       Table name prefix for CSR data (default: csr_graph)

@aheev

aheev commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

Looks good. Two minor nits:

  • ladybug >= 0.17.0 won't work until its released. 0.17.0.dev20260522 < 0.17.0 in some versioning schemes

are we going to release icebug-format before ladybug?

@aheev

aheev commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

do we need ladybug in dependencies at all?

@adsharma

Copy link
Copy Markdown
Collaborator

Good point. Ok to remove.

@aheev
aheev force-pushed the update-icebug-disk branch from 112a662 to 1629152 Compare May 25, 2026 04:26
@aheev
aheev force-pushed the update-icebug-disk branch from 1629152 to dddffda Compare May 25, 2026 04:29
@aheev

aheev commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

Good point. Ok to remove.

done

@adsharma
adsharma merged commit 04ee11f into Ladybug-Memory:main May 25, 2026
1 check passed
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.

2 participants