Skip to content

Conversation

@EdwardArchive
Copy link

@EdwardArchive EdwardArchive commented Nov 24, 2025

INSERT DESCRIPTION HERE

#6839

This PR adds comprehensive support for StarRocks as an OLAP engine in Rill, enabling users to connect to existing StarRocks clusters and power Rill dashboards with external tables.

Overview

https://www.starrocks.io/ is an open-source, high-performance OLAP database designed for real-time analytics. It provides a MySQL-compatible interface with columnar storage and vectorized query execution, making it ideal for large-scale data analytics
workloads.

Key Features

  1. Full OLAP Driver Implementation
  • Implements all required interfaces: OLAPStore, InformationSchema, ModelExecutor, ModelManager
  • Supports both external tables and model creation
  • Materialized views and regular tables are both supported
  1. Flexible Connection Options
  • Individual fields: host, port, username, password, database, ssl
  • DSN format: Two formats supported for maximum flexibility
    • StarRocks URL format (recommended): starrocks://user:password@host:port/database
    • MySQL DSN format: user:password@tcp(host:port)/database?parseTime=true
  1. Comprehensive Type Mapping

Supports all StarRocks data types including:

  • Numeric: BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, DECIMAL variants
  • String: CHAR, VARCHAR, STRING, TEXT, BINARY, VARBINARY
  • Date/Time: DATE, DATETIME (note: StarRocks does not support TIME type)
  • Semi-structured: JSON, ARRAY, MAP, STRUCT
  • Special: HLL, BITMAP, PERCENTILE
  1. Database Management
  • Connector-level database configuration (following ClickHouse pattern)
  • No catalog support (StarRocks catalog.database.table hierarchy handled internally)
  • Automatic database selection from connector config

Implementation Details

Connection Management

  • Uses MySQL wire protocol via github.com/go-sql-driver/mysql
  • Default port: 9030 (MySQL protocol port, not HTTP port 8030)
  • SSL/TLS support via ssl configuration option
  • Connection pooling with configurable limits

Information Schema

  • Lists all databases (excluding system databases: information_schema, statistics, mysql, sys)
  • Lists tables and materialized views per database
  • Provides complete table metadata including column information and types
  • Pagination support for large result sets

Model Execution

  • Supports CREATE TABLE AS SELECT (CTAS)
  • Supports CREATE VIEW AS SELECT for view-based models
  • Incremental model support via INSERT INTO
  • Staging table pattern for atomic updates
  • Proper cleanup of staging tables on errors

Documentation

Added comprehensive documentation at docs/docs/build/connectors/olap/starrocks.md including:

  • Connection configuration examples
  • DSN format explanations (both StarRocks and MySQL formats)
  • Connection parameter descriptions
  • Usage notes and version compatibility (StarRocks v2.5+)

UI Integration

  • Added StarRocks validation schema in web-common/src/features/sources/modal/yupSchemas.ts
  • Supports both DSN and individual field input
  • Port validation (must be numeric)
  • Optional SSL and database fields

Testing

Tested with:

  • StarRocks v4.x cluster
  • TPC-DS benchmark dataset
  • Model creation (both tables and views)
  • MetricsView creation from external tables
  • Dashboard creation from DATA EXPLORER
  • Query execution with various data types

Files Changed

Core Driver Implementation:

  • runtime/drivers/starrocks/starrocks.go - Main driver and configuration
  • runtime/drivers/starrocks/olap.go - OLAP interface implementation
  • runtime/drivers/starrocks/information_schema.go - Schema introspection
  • runtime/drivers/starrocks/model_executor_self.go - Model execution
  • runtime/drivers/starrocks/model_manager.go - Model lifecycle management
  • runtime/drivers/starrocks/transporter.go - Data transfer operations

Documentation:

  • docs/docs/build/connectors/olap/starrocks.md - User documentation

UI:

  • web-common/src/features/sources/modal/yupSchemas.ts - Form validation

Breaking Changes

None. This is a new driver with no impact on existing functionality.

Future Enhancements

Potential areas for future improvement:

  • Cloud deployment support (not included in this PR as it hasn't been tested)
  • Partition-aware query execution
  • Advanced authentication methods

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@EdwardArchive EdwardArchive changed the title Add olap connection type starrocks Add StarRocks Driver Support Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants