0.01
No release in over a year
Wrapper for Lightweight Presto Cluster
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0.0
~> 3.9.0

Runtime

>= 2.0.0, < 3.0
 Project Readme

tiny-presto Actions Status Gem Gem

Tiny Trino cluster to check the compatibility of query result by using the specific Trino version.

NOTE: The brand name of Presto was migrated to Trino. Although the internal docker image used in tiny-presto was also migrated to Trino, we keep the package name tiny-presto to avoid the installation trouble.

Install

$ gem install tiny-presto

Prerequisites

tiny-presto uses Docker to run single node Presto cluster. Please ensure to install the Docker engine properly in advance.

See Docker Engine overview

Usage

You can run the query easily as follows.

rows = TinyPresto.run('show schemas')
# => [["default"], ["information_schema"]]

As tiny-presto uses the memory connector as default, it is also possible to create a table.

TinyPresto.run("create table ctas1 as select * from (values (1, 'a'), (2, 'b')) t(c1, c2)")
rows = TinyPresto.run("select * from ctas1")
# => [[1, 'a'], [2, 'b']]

To check the result consistency, verify method is available.

result = TinyPresto.verify('show schemas', [["default"], ["information_schema"]])
# result is true if the returned value by the query matched with the given expected result.

To ensure to delete the tiny-presto cluster, make sure to call ensure_stop before exiting.

TinyPresto.ensure_stop