Arrow commands
2 commands. Each entry gives the invocation and an example, in the interface you pick; open the details for parameters, return shape and error codes.
export
Export a product primitive to an Arrow-compatible file.
strata arrow export
db.arrow.export(primitive: 'str', path: 'str', *, format: 'str' = 'parquet', collection: 'Optional[str]' = None, event_type: 'Optional[str]' = None, graph: 'Optional[str]' = None, limit: 'Optional[int]' = None, prefix: 'Optional[str]' = None) -> 'Any'
Exports a product primitive from the selected branch and space to an Arrow-compatible file (Parquet, CSV, or JSONL). Graph exports treat the path as a stem and write separate node and edge files. Returns a summary of the exported primitive, the concrete output paths, the row count, and the total output size.
To see the complete help for this command, run:
strata arrow export --helphelp(db.arrow.export)
Example
strata kv put greeting hellostrata command run --command-json '{"format":"parquet","path":"/tmp/exports/kv.parquet","primitive":"kv","type":"arrow_export"}' # One file per primitive; Parquet by default.strata kv delete greetingstrata arrow import /tmp/exports/kv.parquet --target kvstrata kv get greeting
_ = db.kv.put("greeting", "hello")_ = db.arrow.export("kv", tmp_dir + "/kv.parquet", format="parquet") # One file per primitive; Parquet by default._ = db.kv.delete("greeting")_ = db.arrow.import_("kv", tmp_dir + "/kv.parquet")db.kv.get("greeting")
import
Import an Arrow-compatible file into a product primitive.
strata arrow import
db.arrow.import_(target: 'str', path: 'str', *, format: 'Optional[str]' = None, collection: 'Optional[str]' = None, graph: 'Optional[str]' = None, key_column: 'Optional[str]' = None, value_column: 'Optional[str]' = None) -> 'Any'
Imports an Arrow-compatible file (Parquet, CSV, or JSONL) into a product primitive on the selected branch and space. Rows are written through the standard batch commands, so the import commits like any other write. Returns a summary of the target primitive, the input file, and the imported, skipped, and batch counts.
To see the complete help for this command, run:
strata arrow import --helphelp(db.arrow.import_)
Example
strata kv put greeting hellostrata command run --command-json '{"format":"parquet","path":"/tmp/exports/kv.parquet","primitive":"kv","type":"arrow_export"}'strata kv delete greetingstrata arrow import /tmp/exports/kv.parquet --target kv # Rows are keyed by their source column; kv restores greeting=hello.strata kv get greeting
_ = db.kv.put("greeting", "hello")_ = db.arrow.export("kv", tmp_dir + "/kv.parquet", format="parquet")_ = db.kv.delete("greeting")_ = db.arrow.import_("kv", tmp_dir + "/kv.parquet") # Rows are keyed by their source column; kv restores greeting=hello.db.kv.get("greeting")