Skip to content

Latest commit

 

History

History
60 lines (34 loc) · 1.47 KB

README.MD

File metadata and controls

60 lines (34 loc) · 1.47 KB

presto-redis

PrestoDB connector for Redis.

This is an experiment in using PrestoDb to run SQL queries on top of redis. It starts a PrestoDB server and attempts to connect to redis instance on localhost port 6379

The data model is treat maps as if they were tables and objects in maps as rows.

Requirements

The redis collections pakcage should be installed in the local maven repo [Redis Collection}(https://github.com/otaviojava/redis-collections)

Usage

  1. Start the server using gradle (2+). This will start the server on port 8383:
  • gradle runServer
  1. Download presto client and run it using:
  • ./presto --server localhost:8383 --catalog redis -schema maps
  1. Run some SQL queries
  • SHOW TABLES;
  • DESC employees;
  • SELECT * FROM employees WHERE sales < 2000;
  • SELECT active, SUM(sales) FROM employees GROUP BY active;

The server comes with some example data in table employees. More data can be inserted into redis directly

Config

Config is in src/main/resources

Status

Experimental proof of concept.

Warning The server will attempt to wipe all data on the connecting redis instance evey time it starts.

Credits

The overall design is based on the presto hazecast connector. Presto Hazelcast