This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a multi-module Maven project for the Flink SQL Runner - a tool and library ecosystem for running Apache Flink SQL applications. The project is structured as a parent POM with multiple modules providing different functionality.
flink-sql-runner/- Main CLI application and Docker imageconnectors/- Custom Flink connectors (kafka-safe, postgresql)formats/- Custom data formats (flexible-csv, flexible-json)types/- Custom data types (json-type, vector-type)stdlib/- Standard library modules with system functions (json, math, text, vector, openai)testing/- Testing utilities and sample UDF projects
# Full build with all checks
mvn clean install -Pci
# Fast build (skips tests, formatting, license checks)
mvn clean install -Pfast
# Run tests only
mvn test
# Run integration tests
mvn verify
# Code formatting check
mvn spotless:check
# Apply code formatting
mvn spotless:apply
# License header check
mvn license:check
# Apply license headers
mvn license:format# Run SQL file
java -jar flink-sql-runner/target/flink-sql-runner.jar --sqlfile script.sql
# Run compiled plan
java -jar flink-sql-runner/target/flink-sql-runner.jar --planfile plan.json
# With custom configuration
java -jar flink-sql-runner/target/flink-sql-runner.jar --sqlfile script.sql --config-dir config/
# With UDF path
java -jar flink-sql-runner/target/flink-sql-runner.jar --sqlfile script.sql --udfpath /path/to/udfs- Java 17 - Base language version
- Apache Flink 2.2.1 - Stream processing framework
- Maven - Build system
- Lombok - Code generation
- PicoCLI - Command line interface
- JUnit 6 - Testing framework
- Testcontainers - Integration testing
- Docker - Containerization
- Uses Google Java Format for code formatting
- Enforced via Spotless Maven plugin
- License headers are automatically managed
- Separate formatting rules for Flink-specific code (AOSP style)
- Unit tests:
mvn test - Integration tests:
mvn verify(includes failsafe plugin) - Test coverage enforced at 70% minimum via JaCoCo
The main application (CliRunner) processes command-line arguments and delegates to BaseRunner which:
- Initializes Flink configuration
- Resolves environment variables in SQL/JSON files
- Creates
SqlExecutorto run SQL scripts or compiled plans - Handles UDF loading and system function registration
CliRunner- Main entry point and CLI argument processingBaseRunner- Core execution logic and configurationSqlExecutor- Flink SQL script and plan executionEnvVarResolver- Environment variable substitution in configs
New modules should:
- Follow the existing directory structure
- Include proper Maven coordinates under
com.datasqrl.flinkrunner - Add to parent POM modules section
- Include common dependencies from parent (Lombok, JUnit, etc.)