Skip to content

Trino connector for lightweight storage of virtual views

License

Notifications You must be signed in to change notification settings

robfromboulder/viewzoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

viewzoo

This Trino connector stores virtual views, which allow improvising, extending, and re-platforming data sources while seamlessly preserving compatability with all applications. Virtual views are particularly useful for prototyping and updating existing applications to use Apache Iceberg. This is a lightweight connector and does not require configuring a metastore or object storage.

This connector was originally published for my presentation on virtual view hierarchies at Trino Summit 2024, and is being maintained as a small way to give back to the Trino community.

CodeFactor Contributing License

Dependencies

  • Java 23
  • Trino 470

Configuring Local Environment

1. Install Trino
download and expand tarball to local directory
export TRINO_HOME=$HOME/...

2. Create $TRINO_HOME/etc/catalog/viewzoo.properties:
connector.name=viewzoo
viewzoo.dir=/tmp/viewzoo

3. Build the connector and redeploy
mvn clean package && rm -rf $TRINO_HOME/plugin/viewzoo /tmp/viewzoo && cp -r ./target/viewzoo-470 $TRINO_HOME/plugin/viewzoo && mkdir -p /tmp/viewzoo

4. Start Trino
cd $TRINO_HOME
bash bin/launcher run

Defining and Using Views

Create a view with a static result set:

create or replace view viewzoo.example.hello as select * from (values (1, 'a'), (2, 'b'), (3, 'c')) as t (key, value)

Select rows from the view:

select * from viewzoo.example.hello

Delete the view:

drop view viewzoo.example.hello

© 2024-2025 Rob Dickinson (robfromboulder)

About

Trino connector for lightweight storage of virtual views

Resources

License

Stars

Watchers

Forks

Languages