This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ViewZoo is a Trino connector that stores views using either filesystem storage (JSON files) or a PostgreSQL database, without requiring a Hive-compatible metastore or object storage.
Trino uses only major version numbers (478, 479, etc.) rather than semantic versioning, and breaking changes can occur with any release. viewzoo maintains a separate branch for each Trino version (e.g., v478 for Trino version 478).
- Each version branch is compatible with that one specific Trino version
- New version branches are created from the previous version branch
- Changes to version branches are not merged back to main
- The main branch is not actively used; version branches are primary
- PRs should target the version branch, not main
# Full build
mvn clean package
# Run all tests
mvn test
# Run single test
mvn test -Dtest=TestViewZooBaseConfig
# Install to Trino
mvn clean package && rm -rf $TRINO_HOME/plugin/viewzoo && cp -r ./target/viewzoo-479 $TRINO_HOME/plugin/viewzoo
# Check dependency updates
mvn versions:display-dependency-updates
# Run integration tests
mvn test -Pintegration- ViewZooPlugin - Trino plugin entry point, registers connector factory
- ViewZooConnectorFactory - Creates connectors, sets up Guice DI with ViewZooModule
- ViewZooModule - Guice module that binds configurations and wires StorageClient via provider
- ViewZooConnector - Manages lifecycle and provides ViewZooMetadata
- ViewZooMetadata - All view CRUD operations (create/drop/list/get views), maintains in-memory cache
- ViewZooStorageClient - Interface for storage backends
- ViewZooStorageClientProvider - Factory selecting implementation based on config
- ViewZooLocalFileSystemClient - Stores views as JSON files (
schema.table.json) - ViewZooJdbcClient - Stores views in PostgreSQL
viewzootable
- ViewZooBaseConfig -
viewzoo.storage_type(filesystem/jdbc) - ViewZooFilesystemConfig -
viewzoo.dirfor JSON file storage - ViewZooJdbcConfig - JDBC connection settings for PostgreSQL
- Provider Pattern: Storage implementation selected at runtime via ViewZooStorageClientProvider
- Synchronized Access: ViewZooMetadata uses synchronized methods for thread safety
- In-Memory Caching: Views loaded once at startup, not watched for external changes
- Singleton Scope: Connector, Metadata, and StorageClient are Guice singletons
Integration tests use Docker Compose to run PostgreSQL and Trino with the viewzoo connector.
- Location:
src/test/docker/contains docker-compose.yml and Trino catalog configs - Catalogs: Tests run against both
testjdbc(PostgreSQL storage) andtestfs(filesystem storage) - Ports: Uses non-standard port 7721 for Trino to avoid conflicts; PostgreSQL is internal only
- Requirements: Docker must be running; plugin must be built first with
mvn clean package - Environment: Tests set
PROJECT_ROOTenv var to locate the built plugin
- Views stored as serialized
ConnectorViewDefinitionobjects - Only supports READ_COMMITTED isolation level
- Uses Airlift configuration framework with
@Configannotations - Mark credentials with
@ConfigSecuritySensitive - Uses TestNG for tests with Airlift configuration assertions
- IntelliJ IDEA defaults with 130-character line length
- Copyright header: "© 2024-2026 Rob Dickinson (robfromboulder)"
- Use
TrinoExceptionwith appropriate error codes for errors