Skip to main content

Crate ursa_engine

Crate ursa_engine 

Source
Expand description

Ursa’s SQL engine session.

new_session builds a DataFusion SessionContext on which a file is a table: SELECT * FROM 'edges.parquet', 'edges.csv.gz', 'edges/', 'edges/*.parquet', 'events.jsonl', and the same over s3://, gs://, az:// and https://, with object stores registered the first time a URL is read. read_parquet, read_csv and read_json read the same with options (read_functions).

Graphs are defined per session (graph). A session may have a .ursa database (database), which keeps its catalog between processes.

Re-exports§

pub use error::user_message;
pub use stores::ensure_object_store;
pub use stores::ensure_object_store_for;

Modules§

database
The .ursa database file: a session’s catalog, kept between processes.
error
Error messages for people, not programmers.
graph
Graphs in a session: their definitions and where they are kept.
options
Ursa’s session settings, set with SET ursa.<name> = … and shown with SHOW ursa.<name>: a DataFusion config extension with the prefix ursa.
paths
Turning a name in FROM into a file location.
read_functions
read_parquet(path), read_csv(path, header => false) and read_json(path): files as tables, as in DuckDB.
serial
Plans that run on one task, for the browser (#278).
stores
Object stores, registered the first time a query names a URL.

Structs§

BlockingError
Why blocking work produced no result: it panicked or was cancelled. Only a native build can see one; inline work on wasm32 cannot fail this way.
FileOptions
How to read files, beyond what their extension says: the options of read_csv(...) and its siblings. None leaves a choice to the extension or to the session’s defaults.

Enums§

FileFormat
A file format Ursa reads.

Functions§

new_session
A session with Ursa’s defaults.
new_session_with_config
A session with Ursa’s file tables over config. information_schema is turned on, so SHOW TABLES and SHOW COLUMNS work.
open_file_table
Open location (a path, glob, directory or URL) as a listing table. The format and compression come from the file extension; Hive-style partition directories (year=2024/) become columns. A relative path is relative to the current directory, in a session with a database too: a stored definition’s paths are made relative to the database’s directory when it is stored, and resolved against it on replay (see crate::database).
open_files
Open locations (paths, globs, directories or URLs) as one listing table, read as options say. What options leaves open comes from the extension of the first file found, as DataFusion infers it; a directory or glob lists only the files with that extension. Each location must name a file.
run_blocking
Run f off the async workers (native), or inline (wasm32).