Feast Trino banner
Shopify Shopify

Feast Trino

Development community

Description

Trino offline store plugin for Feast. This supports most of the Trino connectors.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Feast Trino Support

Trino is not included in current [Feast](https://github.com/feast-dev/feast) roadmap, this project intends to add Trino support for Offline Store.

Version compatibilities

The feast-trino plugin is tested on the following versions of python [3.7, 3.8, 3.9]

Here is also how the current feast-trino plugin has been tested against different versions of Feast and Trino

Feast-trino Feast Trino
1.0.* From 0.15.* to 0.16.* 364

Quickstart

Install feast-trino

  • Install stable version
pip install feast-trino
  • Install develop version (not stable):
pip install git+https://github.com/shopify/feast-trino.git@main

Create a feature repository

feast init feature_repo

Edit `feature_store.yaml`

set `offline_store` type to be `feast_trino.TrinoOfflineStore`

project: feature_repo
registry: data/registry.db
provider: local
offline_store:
    type: feast_trino.trino.TrinoOfflineStore
    host: localhost
    port: 8080
    catalog: memory
    connector:
        type: memory
online_store:
    path: data/online_store.db

Create Trino Table

Edit `feature_repo/example.py`

# This is an example feature definition file
import pandas as pd
from google.protobuf.duration_pb2 import Duration
from feast import Entity, Feature, FeatureView, FileSource, ValueType, FeatureStore

from feast_trino.connectors.upload import upload_pandas_dataframe_to_trino
from feast_trino import TrinoSource
from feast_trino.trino_utils import Trino

store = FeatureStore(repo_path="feature_repo")

client = Trino(
    user="user",
    catalog=store.config.offline_store.catalog,
    host=store.config.offline_store.host,
    port=store.config.offline_store.port,
)
client.execute_query("CREATE SCHEMA IF NOT EXISTS feast")
client.execute_query("DROP TABLE IF EXISTS feast.driver_stats")

input_d