Redis SQL is a Trino connector which allows access to RediSearch data from Trino.
Note
|
RediSearch 2.0 or later is required. |
Documentation is available at https://redis-field-engineering.github.io/redis-sql.
Contact us on the Redis Forum or create an issue on Github where we provide support on a good faith effort basis.
Clone the project
git clone https://github.com/redis-field-engineering/redis-sql.git
cd redis-sql
Launch the containers
docker-compose up
Create a RediSearch index
docker exec redis /usr/local/bin/redis-cli FT.CREATE beers ON HASH PREFIX 1 beer: SCHEMA id TAG SORTABLE brewery_id TAG SORTABLE name TEXT SORTABLE abv NUMERIC SORTABLE descript TEXT style_name TAG SORTABLE cat_name TAG SORTABLE
Add documents to the index
docker run --add-host=host.docker.internal:host-gateway fieldengineering/riot-file -h host.docker.internal import https://storage.googleapis.com/jrx/beers.json hset --keyspace beer --keys id
Run the Trino CLI
docker exec -it trino trino --catalog redisearch --schema default
Run a SQL query
trino:default> SELECT * FROM beers;