rill icon indicating copy to clipboard operation
rill copied to clipboard

[Feature] Add StarRocks Driver Support

Open EdwardArchive opened this issue 3 weeks ago • 10 comments

Issue : https://github.com/rilldata/rill/issues/6839 Related PR : #8390 (priveus)

PR: StarRocks OLAP Connector (Read-Only)

What is StarRocks

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.

Summary

Add StarRocks as an OLAP connector to directly query existing StarRocks tables. This is a read-only OLAP connector - Model Execution is not supported.

Changes

1. Backend - StarRocks Driver (runtime/drivers/starrocks/) - 5 files

File Status Changes
starrocks.go Added Connection logic, database field optional, OLAP interface only
olap.go Added Query execution with fully qualified table names
information_schema.go Added Table/column metadata retrieval with catalog support
utils.go Added Utility functions for StarRocks-specific SQL
starrocks_test.go Added Test cases for connection and queries

2. Backend - Query Dialect Support (runtime/queries/) - 14 files

File Status Changes
column_cardinality.go Modified Added StarRocks dialect with approx_count_distinct()
column_null_count.go Modified Added StarRocks dialect support
column_desc_stats.go Modified Added StarRocks with percentile_approx(), stddev_samp()
column_time_range.go Modified Added StarRocks dialect support
column_time_grain.go Modified Added StarRocks-specific time functions
column_topk.go Modified Added StarRocks dialect support
column_rug_histogram.go Modified Returns empty result for StarRocks
column_numeric_histogram.go Modified Returns empty result for StarRocks
column_timeseries.go Modified Returns empty result for StarRocks (no TEMP TABLE)
table_head.go Modified Added StarRocks to supportedTableHeadDialects
table_cardinality.go Modified Added StarRocks dialect support
sqlutil.go Modified Added StarRocks to dialect utilities
resource_watermark.go Modified Added StarRocks dialect support

Query Support Summary:

Query Status Notes
TableHead, TableColumns, TableCardinality Full
ColumnCardinality, ColumnNullCount, ColumnTopK Full
ColumnDescriptiveStatistics Full percentile_approx(), stddev_samp()
ColumnTimeRange, ColumnTimeGrain Full StarRocks-specific SQL
ColumnRugHistogram, ColumnNumericHistogram Empty Performance issues
ColumnTimeseries Empty TEMP TABLE not supported

3. Backend - Other (runtime/, cli/) - 2 files

File Status Changes
runtime/drivers/olap.go Modified StarRocks dialect registration
cli/cmd/runtime/start.go Modified StarRocks driver initialization

4. Frontend (web-common/, web-local/) - 8 files

File Status Changes
web-common/src/features/sources/modal/yupSchemas.ts Modified Database field optional (matches backend)
web-common/src/features/sources/modal/constants.ts Modified StarRocks connector constants
web-common/src/features/sources/modal/icons.ts Modified StarRocks icon import
web-common/src/features/connectors/connectors-utils.ts Modified StarRocks connector utilities
web-common/src/features/connectors/connector-icon-mapping.ts Modified StarRocks icon mapping
web-common/src/components/icons/connectors/StarRocks.svelte Added StarRocks icon component
web-common/src/components/icons/connectors/StarRocksIcon.svelte Added StarRocks icon variant
web-local/src/routes/.../connector/starrocks/[name]/[database]/[schema]/[table]/+page.svelte Added StarRocks table page
web-local/src/routes/.../connector/starrocks/+page.ts Added StarRocks connector page route

5. Documentation - 1 file

File Status Changes
docs/docs/build/connectors/olap/starrocks.md Added StarRocks OLAP connector documentation

StarRocks Naming Mapping

Rill API Parameter StarRocks Concept Example
database Catalog default_catalog, iceberg_catalog
databaseSchema Database tpcds_100gb, my_database
table Table store_sales, customer

Tested

  • [ ] Connection: default_catalog, external catalogs (Iceberg/Hive), DSN format
  • [ ] Table browsing: list tables, preview data, column metadata
  • [ ] Profiling: cardinality, null count, statistics, TopK, time range/grain
  • [ ] UI: connector modal, optional database field, table preview

Known Limitations

  1. No Model Execution: Read-only OLAP connector only
  2. No Histogram: Returns empty results due to performance issues
  3. No Timeseries: Returns empty results (TEMP TABLE not supported)
  4. MySQL Protocol: Uses StarRocks MySQL-compatible protocol (port 9030)
  5. default_catalog on DSN : MySQL don't have Catalog

EdwardArchive avatar Dec 05 '25 10:12 EdwardArchive

I just working on it find some edge case

EdwardArchive avatar Dec 05 '25 13:12 EdwardArchive

@k-anshul Hi, Can you help review this change so we can move it forward?

EdwardArchive avatar Dec 07 '25 13:12 EdwardArchive

Thank you for the Hard works! I'll fixed it

EdwardArchive avatar Dec 08 '25 07:12 EdwardArchive

Also tagging @ericpgreen2 for review on frontend changes.

k-anshul avatar Dec 08 '25 09:12 k-anshul

Hi @k-anshul,

Thank you so much for taking the time to review my code — I really appreciate it, especially since it was likely during the weekend or early morning hours.

I've addressed all of your review comments. Please let me know if you have any questions or concerns.

Have a great day!

EdwardArchive avatar Dec 09 '25 01:12 EdwardArchive

Hey @EdwardArchive

Thanks for your work here. I added some more comments. Mostly should be minor. Please also take a look at the failing checks.

k-anshul avatar Dec 09 '25 06:12 k-anshul

Hey @EdwardArchive

Thanks for your work here. I added some more comments. Mostly should be minor. Please also take a look at the failing checks.

Hey @k-anshul
I'll take care of this. thanks again.

EdwardArchive avatar Dec 09 '25 10:12 EdwardArchive

Hey @k-anshul, I’ve made a number of the changes you suggested. Please review when you get a chance.

EdwardArchive avatar Dec 09 '25 14:12 EdwardArchive

Hey @EdwardArchive

Please also fix the failing checks.

k-anshul avatar Dec 10 '25 06:12 k-anshul

Hi sorry for late, I just fix the failing checks.

EdwardArchive avatar Dec 10 '25 20:12 EdwardArchive

Hey

Thanks @EdwardArchive The backend changes looks good to me. Please take a look at the failing test(TestConfigPropertiesValidate/both_dsn_and_host ) and Web code quality checks action.

Eric is going to take a look at UI changes as soon as he gets some bandwidth.

k-anshul avatar Dec 11 '25 05:12 k-anshul

Hey @k-anshul

Thanks for the hard work again. good, I'll wait for the Eric's review

Thanks again, Have a great day!

EdwardArchive avatar Dec 11 '25 07:12 EdwardArchive

@lovincyrus, given your ownership of the connector forms, can you please do the first frontend reviews of this code? For now, I've removed myself as reviewer and tagged you. Once the PR has your sign-off, then please request a review from me and I'll do a final review. Thank you!

ericpgreen2 avatar Dec 12 '25 21:12 ericpgreen2

@lovincyrus
Thanks a lot for your review!
I’ve updated the code as per your suggestions

EdwardArchive avatar Dec 18 '25 10:12 EdwardArchive

Sorry for the repeated review.
I've synced all changes to the main branch, excluding the icon-related frontend updates.
Thank you once again for your thorough feedback.

EdwardArchive avatar Dec 19 '25 18:12 EdwardArchive

@lovincyrus, given your ownership of the connector forms, can you please do the first frontend reviews of this code? For now, I've removed myself as reviewer and tagged you. Once the PR has your sign-off, then please request a review from me and I'll do a final review. Thank you!

This branch is now focused on supporting the StarRocks driver and adding some icons. Requesting the final +1 @ericpgreen2

lovincyrus avatar Dec 22 '25 08:12 lovincyrus