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
.ursadatabase 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 withSHOW ursa.<name>: a DataFusion config extension with the prefixursa. - paths
- Turning a name in
FROMinto a file location. - read_
functions read_parquet(path),read_csv(path, header => false)andread_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§
- Blocking
Error - 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.
- File
Options - How to read files, beyond what their extension says: the options of
read_csv(...)and its siblings.Noneleaves a choice to the extension or to the session’s defaults.
Enums§
- File
Format - 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_schemais turned on, soSHOW TABLESandSHOW COLUMNSwork. - 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 (seecrate::database). - open_
files - Open
locations(paths, globs, directories or URLs) as one listing table, read asoptionssay. Whatoptionsleaves 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
foff the async workers (native), or inline (wasm32).