contrastdata/lakeserve
À propos
Lakeserve: Ultrafast, realtime database on Iceberg, Spark Connect compatible.
Données et analyseProgression mesurée des étoiles
- in 24h
- Historique en cours
- in 7 days
- Historique en cours
- in 15 days
- Historique en cours
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalContrast Lakeserve
Realtime analytics on Apache Iceberg, compatible with Apache Spark Connect. Written in Rust.
Status: preview. See status.
Benchmarks · Quickstart · Documentation · Deploying · Continuous integration · Issues
We like building things for the data community, and Lakeserve is one of them. If it's useful to you, star the repo so more people find it. We post what we're working on at contrastdb.com, on X and on LinkedIn.
Overview
Lakeserve is a SQL server for Iceberg tables. Query files from a shell with no server at all, run it on a laptop as a local database with one command, or as a coordinator with workers in front of a catalog and object storage. Clients connect over Apache Spark Connect, so PySpark and other Spark clients work unchanged, or send SQL over HTTP.
Benchmarks
TPC-H, TPC-DS and ClickBench from scale factor 1 to 1000, on one machine and on a cluster: contrastdb.com/bench (contrastdata/lakeserve-benchmarks), with the methodology and how to reproduce them.
Quickstart
Install the latest build for macOS on Apple silicon or Linux on x86-64 or ARM64:
curl -fsSL https://lakeserve.contrastdb.com | sh
The installer checks the download's SHA-256 and puts lakeserve in ~/.local/bin.
Query files right away
lakeserve local runs SQL and exits, with no server or setup, like clickhouse local. Query
three million New York taxi trips in a public Parquet file, without downloading it:
lakeserve local -q "SELECT passenger_count, count(*) AS trips, round(avg(total_amount), 2) AS avg_total
FROM 'https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2024-01.parquet'
GROUP BY passenger_count ORDER BY trips DESC LIMIT 3"
╭─────────────────┬─────────┬───────────╮
│ passenger_count ┆ trips ┆ avg_total │
╞═════════════════╪═════════╪═══════════╡
│ 1 ┆ 2188739 ┆ 26.21 │
│ 2 ┆ 405103 ┆ 29.52 │
│ NULL ┆ 140162 ┆ 25.81 │
╰─────────────────┴─────────┴───────────╯
Your own files work the same way, by path or glob, in Parquet, CSV or JSON, on disk, in S3 or piped in:
lakeserve local -q "SELECT city, avg(fare) FROM 'trips/*.parquet' GROUP BY city"
cat events.csv | lakeserve local -q "SELECT type, count(*) FROM stdin GROUP BY type"
lakeserve local -q "SELECT * FROM 'events.csv'" --format parquet > events.parquet
lakeserve local # a prompt, with history
See querying files for formats, output, scripts and keeping tables.
Run a local database
lakeserve start keeps Iceberg tables in ~/.lakeserve and serves them to Spark clients, a web
UI and HTTP:
lakeserve start
Open the web UI at http://127.0.0.1:15080, or query from a shell:
lakeserve client --query "CREATE TABLE trips (id BIGINT, city STRING, fare DOUBLE)"
lakeserve client --query "INSERT INTO trips VALUES (1, 'Oslo', 12.5), (2, 'Lima', 7.0)"
lakeserve client --query "SELECT city, sum(fare) FROM trips GROUP BY city"
Or connect with PySpark:
from pyspark.sql import SparkSession
spark = SparkSession.builder.remote("sc://127.0.0.1:15002").getOrCreate()
spark.sql("SELECT * FROM trips").show()
Or over HTTP:
curl -s http://127.0.0.1:15080/v1/query -d '{"sql": "SELECT 1 AS one"}'
lakeserve install keeps it running in the background and at every login. See the
command line for that, passwords and listening beyond this host.
Learn more
- Querying files:
lakeserve localover files, standard input, URLs and Iceberg tables, in a shell or a script. - Local database: what
lakeserve startsets up, and running it in the background. - Deploying: a coordinator and workers, with an NVMe block cache on each worker.
- Catalogs and storage: AWS Glue, Iceberg REST and local catalogs on S3 or local disk.
- Iceberg: tables are standard Parquet-based Iceberg tables that Spark, Trino and DuckDB can read. Small inserts into a local warehouse commit in milliseconds; through a REST catalog on object storage they take as long as the catalog's commit. Compaction and snapshot expiry stay with Spark or the catalog.
- Spark Connect and the HTTP API: what clients can send.
- SQL statements, functions and session settings.
- Performance tuning, capacity and monitoring.
- All documentation, and the code map for contributors.
Run it on Contrast
Already on Iceberg in S3? Contrast runs Lakeserve next to your data, with support and an SLA, on tables in buckets you own and on Iceberg tables you already manage. Book a call to set it up.
Status
Lakeserve is preview software. Configuration and on-disk state may change between releases. Structured Streaming and client-sent code (Python, pandas and JVM UDFs, Python data sources) are not supported yet and are rejected with an error. Changes are tested nightly against Spark with the suites in bench/verify; see continuous integration.
Contributing
Bug reports and pull requests are welcome. CONTRIBUTING.md covers building from source and the checks to run, SECURITY.md says how to report a vulnerability, and everyone follows the code of conduct. Questions go to [email protected].
License
Lakeserve is licensed under Apache-2.0. It started as a fork of
Sail and has since diverged significantly; it builds on
Apache DataFusion. See NOTICE for attribution. Release archives and the container
image hold the licenses of the crates the binary links, in THIRD-PARTY-LICENSES.txt.
Apache Spark, Spark, Apache Iceberg, Iceberg, Apache DataFusion, DataFusion, Apache Arrow, Arrow and the Apache feather logo are trademarks of The Apache Software Foundation. Lakeserve is not affiliated with or endorsed by The Apache Software Foundation.
Explorer des projets similaires
Chargement…