Go to file
Binglin Chang 8d83da4fdb
[Enhancement] Add scripting ability to BE (#20351)
This PR adds scripting ability to BE, as a way to increase system observability, making testing, debugging and online hot fix issues easier. The script engine uses wren script language and wrenbind17 binding util(it's a small OO language). 
Currently, only a small faction of BE objects & methods are bonded, mainly focusing on StorageEngine(Tablets, Rowsets, TabletUpates). 
Will add more binding for rocksdb metadata, thread/stack dumps, memory/cpu profiling utils in the future.

Sample uses cases:

```
mysql> admin execute on 10004 '
    '> var ts = StorageEngine.get_tablet_infos(-1,-1)
    '> for (t in ts) {
    '>     System.print("%(t.tablet_id) %(t.data_size)")
    '> }
    '> ';
Query OK, 0 rows affected (0.01 sec)
10009 0
10011 0
10013 0
...

mysql> admin execute on 10004 '
    '> var t = StorageEngine.get_tablet(11005)
    '> System.print("info: %(t.updates().toPB().toString())")
    '> ';
Query OK, 0 rows affected (0.00 sec)
info: {"versions":[{"version":{"major":"3","minor":"1"},"creationTime":"1679897711","rowsets":[2],"compaction":{"startVersion":{"major":"3","minor":"0"},"inputs":[0,1],"outputs":[2]}},{"version":{"major":"4","minor":"0"},"creationTime":"1679900665","rowsets":[2,3],"deltas":[3]},{"version":{"major":"5","minor":"0"},"creationTime":"1679900666","rowsets":[2,3,4],"deltas":[4]},{"version":{"major":"6","minor":"0"},"creationTime":"1679900667","rowsets":[2,3,4,5],"deltas":[5]},{"version":{"major":"7","minor":"0"},"creationTime":"1679900667","rowsets":[2,3,4,5,6],"deltas":[6]},{"version":{"major":"8","minor":"0"},"creationTime":"1679900667","rowsets":[2,3,4,5,6,7],"deltas":[7]},{"version":{"major":"9","minor":"0"},"creationTime":"1679900667","rowsets":[2,3,4,5,6,7,8],"deltas":[8]},{"version":{"major":"10","minor":"0"},"creationTime":"1679900668","rowsets":[2,3,4,5,6,7,8,9],"deltas":[9]},{"version":{"major":"11","minor":"0"},"creationTime":"1679900668","rowsets":[2,3,4,5,6,7,8,9,10],"deltas":[10]},{"version":{"major":"12","minor":"0"},"creationTime":"1679900668","rowsets":[2,3,4,5,6,7,8,9,10,11],"deltas":[11]},{"version":{"major":"13","minor":"0"},"creationTime":"1679900668","rowsets":[2,3,4,5,6,7,8,9,10,11,12],"deltas":[12]},{"version":{"major":"13","minor":"1"},"creationTime":"1679900708","rowsets":[13],"compaction":{"startVersion":{"major":"13","minor":"0"},"inputs":[2,3,4,5,6,7,8,9,10,11,12],"outputs":[13]}}],"applyVersion":{"major":"13","minor":"1"},"nextRowsetId":14,"nextLogId":"28"}


mysql> admin execute on 10004 '
    '> for (dir in StorageEngine.get_data_dirs()) {
    '>     System.print("dir: %(dir.path()) rocksdb: %(dir.get_meta().sst_file_size())")
    '>     var result = dir.get_meta().compact().toString()
    '>     System.print("compact %(result) size: %(dir.get_meta().sst_file_size())")
    '> }
    '> ';
Query OK, 0 rows affected (0.00 sec)
dir: /home/decster/projects/starrocks/localrun/be/storage rocksdb: 156484
compact OK size: 12708

```

Signed-off-by: Binglin Chang <decstery@gmail.com>
2023-03-31 09:37:28 +08:00
.github [Tool] Pipeline show logs in admit report (#20537) 2023-03-29 14:29:25 +08:00
be [Enhancement] Add scripting ability to BE (#20351) 2023-03-31 09:37:28 +08:00
bin Revert "[Enhancement] Import starcache submodule to support DLA block cache. (#20164)" (#20422) 2023-03-28 15:11:06 +08:00
build-support [Refactor] remove some unused code (#16512) 2023-01-11 19:50:44 +08:00
community Update members.md (#18528) 2023-02-27 10:34:49 +08:00
conf [Feature] Configure starlet cache in storage dir (#19778) 2023-03-22 14:50:50 +08:00
contrib [Feature]support airbyte destination plugin (#20024) 2023-03-23 13:21:39 +08:00
docker [Tool][Dockerfile] Clean deprecated dockerfiles (#20634) 2023-03-30 14:01:43 +08:00
docs [Doc] add automatic partitioning (#20577) 2023-03-30 17:13:40 +08:00
fe [Enhancement] Add scripting ability to BE (#20351) 2023-03-31 09:37:28 +08:00
fs_brokers/apache_hdfs_broker Support Broker Load/Export Table from volcengine tos (#17027) 2023-02-28 20:25:04 +08:00
gensrc [Enhancement] Add be_compactions to information_schema (#20124) 2023-03-30 14:18:18 +08:00
images Move png to images doc (#8537) 2022-07-11 16:39:52 +08:00
java-extensions [Enhancement] Use log4j to control hudi logs (#19509) 2023-03-21 17:35:18 +08:00
licenses [Enhancement] Add scripting ability to BE (#20351) 2023-03-31 09:37:28 +08:00
licenses-binary [Enhancement] Add tracing util for FE (#7220) 2022-06-16 12:02:42 +08:00
test [UT] Fix sql test for automatic partition & information_schema loads (#20594) 2023-03-29 22:11:23 +08:00
thirdparty [BugFix] Fix hive catalog can't read hive table with textfile lzo format bug (part 1: add thirdparty) (#20191) 2023-03-24 16:07:14 +08:00
tools [Refactor] change the permission mode of tool script file (#17053) 2023-01-31 11:44:01 +08:00
webroot Upgrade web frontend lib for enhanced security (#152) 2021-09-11 10:21:43 +08:00
.clang-format [Refactor] Fix clang-format-11 compatible with clang-format-10.3 (#13791) 2022-11-21 16:56:12 -08:00
.clang-tidy [Refactor] fix .clang-tidy and apply (#12763) 2022-11-01 10:36:53 -07:00
.dockerignore [BugFix] remove .git/ from dockerignore file (#20682) 2023-03-30 21:47:58 +08:00
.gitignore [Enhancement] array_function support nested-type (#19040) 2023-03-29 15:05:15 +08:00
.mergify.yml Update .mergify.yml (#20441) 2023-03-28 16:06:35 +08:00
CODE_OF_CONDUCT.md Init commit 2021-09-04 22:14:12 +08:00
CONTRIBUTING.md Updata new Contributing Guide (#7169) 2022-06-13 18:18:08 +08:00
LICENSE.txt [License] License under Apache License, Version 2.0 (#14655) 2022-12-05 10:00:27 -08:00
NOTICE.txt [Refactor] Change the license from StarRocks Limited to StarRocks Inc (#10093) 2022-08-17 14:05:09 +08:00
README.md [Doc] Add blog link (#16400) 2023-01-09 17:48:19 -08:00
build.sh Revert "[Enhancement] Import starcache submodule to support DLA block cache. (#20164)" (#20422) 2023-03-28 15:11:06 +08:00
env.sh make fe buildable on apple MAC (#15356) 2022-12-16 09:07:05 -08:00
run-be-ut.sh Revert "[Enhancement] Import starcache submodule to support DLA block cache. (#20164)" (#20422) 2023-03-28 15:11:06 +08:00
run-fe-ut.sh [Refactor] Unify the unit tests related names for BE and FE (#15667) 2023-01-10 15:12:33 +08:00

README.md

Download | Docs | Benchmarks | Demo

JAVA&C++ Commit Activities Open Issues Website Slack Twitter

StarRocks is the next-generation data platform designed to make data-intensive real-time analytics fast and easy. It delivers query speeds 5 to 10 times faster than other popular solutions. StarRocks can perform real-time analytics well while updating historical records. It can also enhance real-time analytics with historical data from data lakes easily. With StarRocks, you can get rid of the de-normalized tables and get the best performance and flexibility.

Learn more 👉🏻 Introduction to StarRocks



Features

  • 🚀 Native vectorized SQL engine: StarRocks adopts vectorization technology to make full use of the parallel computing power of CPU, achieving sub-second query returns in multi-dimensional analyses, which is 5 to 10 times faster than previous systems.
  • 📊 Standard SQL: StarRocks supports ANSI SQL syntax (fully supported TPC-H and TPC-DS). It is also compatible with the MySQL protocol. Various clients and BI software can be used to access StarRocks.
  • 💡 Smart query optimization: StarRocks can optimize complex queries through CBO (Cost Based Optimizer). With a better execution plan, the data analysis efficiency will be greatly improved.
  • Real-time update: The updated model of StarRocks can perform upsert/delete operations according to the primary key, and achieve efficient query while concurrent updates.
  • 🪟 Intelligent materialized view: The materialized view of StarRocks can be automatically updated during the data import and automatically selected when the query is executed.
  • Querying data in data lakes directly: StarRocks allows direct access to data from Apache Hive™, Apache Iceberg™, and Apache Hudi™ without importing.
  • 🎛️ Resource management: This feature allows StarRocks to limit resource consumption for queries and implement isolation and efficient use of resources among tenants in the same cluster.
  • 💠 Easy to maintain: Simple architecture makes StarRocks easy to deploy, maintain and scale out. StarRocks tunes its query plan agilely, balances the resources when the cluster is scaled in or out, and recovers the data replica under node failure automatically.

Architecture Overview

StarRockss streamlined architecture is mainly composed of two modulesFrontend (FE) and Backend (BE). The entire system eliminates single points of failure through seamless and horizontal scaling of FE and BE, as well as replication of metadata and data.


Resources

📚 Read the docs

Section Description
Deploy Learn how to run and configure StarRocks.
Docs Full documentation.
Blogs StarRocks deep dive and user stories.

Get support


Contributing to StarRocks

We welcome all kinds of contributions from the community, individuals and partners. We owe our success to your active involvement.

  1. See Contributing.md to get started.
  2. Set up StarRocks development environment:
  1. Understand our GitHub workflow for opening a pull request; use this PR Template when submitting a pull request.
  2. Pick a good first issue and start contributing.

📝 License: StarRocks is licensed under Apache License 2.0.

👥 Community Membership: Learn more about different contributor roles in StarRocks community.


Used By

This project is used by the following companies. Learn more about their use cases:


Acknowledgment

StarRocks is built upon Apache® Doris™ 0.13 in early 2020. We have recreated many important parts of the database including a full vectorized execution engine, a brand new CBO optimizer, a novel real-time update engine, and query federation for data lakes.

Today, only less than 20% of the code in StarRocks is from Apache® Doris™.