The source code of my blog: Build your own S3-Select in 400 lines of Rust.
You may also want to checkout LiquidCache, a more feature-rich version of this project.
git clone https://github.com/XiangpengHao/build-your-own-s3-select.git
cd build-your-own-s3-select
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo run --bin server
cargo run --bin client
You should see the following output.
Note the SQL to pushdown only contains filters and projection, i.e., no DISTINCT
or GROUP BY
.
SQL to run:
-------
SELECT DISTINCT "city" FROM "aws-edge-locations" WHERE "country" = 'United States'
-------
SQL to pushdown:
-------
SELECT "aws-edge-locations"."city" FROM "aws-edge-locations" WHERE ("aws-edge-locations"."country" = 'United States')
-------
+----------------+
| city |
+----------------+
| Boston |
| Chicago |
| Portland |
| New York |
| Newark |
| Detroit |
...
Note that we have more than 50 lines of imports.
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
Rust 2 484 431 1 52