https://github.com/alibaba/rsqldb
https://github.com/alibaba/rsqldb
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alibaba/rsqldb
- Owner: alibaba
- License: apache-2.0
- Created: 2021-10-13T03:56:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-21T08:52:40.000Z (about 2 years ago)
- Last Synced: 2025-05-11T17:37:24.167Z (10 months ago)
- Language: Java
- Size: 49.9 MB
- Stars: 61
- Watchers: 9
- Forks: 23
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-java - RSQLDB
README
## RSQLDB
The database build for stream processing.
## Overview
RSQLDB is a database for stream processing build on the of RocketMQ. It is distributed, highly available,scalable. SQL can be used to define a stream processing task, and
RSQLDB parse it into a stream-processing task. RSQLDB offers the fellow core features:
- Restful API - create, query, stop, stream-processing tasks;
- Standard SQL - describe the stream processing task with standard sql;
- Materialized views - incremental calculation on the of stream;
## Deploy
### Run RocketMQ 5.0 locally
Steps are as follows:
- **Install Java**
- **Download RocketMQ**
- **Start NameServer**
- **Start Broker**
More details can be obtained at [quick start](https://rocketmq.apache.org/zh/docs/quickStart/02quickstart);
### Run RSQLDB
#### From source code:
- Git clone and compile
```shell
git clone git@github.com:alibaba/rsqldb.git
#compile antlr4 file to source code:
mvn clean compile -DskipTests
```
* Run the entrance method:
```java
com.alibaba.rsqldb.rest.Application
````
#### From distribution package
- Download distribution package
- Unzip package
```shell
unzip rsqldb-distribution.zip
```
- Start rsqldb
```shell
cd rsqldb && sh bin/start.sh
```
## Use Cases and Examples
### Filter
```shell
select *
from sourceTable where age>20 and name like '%mack';
```
### Join
```shell
SELECT Websites.name as `count`, Websites.url as url, SUM(access_log.count) AS nums
FROM access_log
WHERE access_log.`count` > 100
INNER JOIN Websites ON access_log.site_id=Websites.id and access_log.url=Websites.url
```
### Window
```sql
select
TUMBLE_START(ts, INTERVAL '5' SECOND) AS window_start,
TUMBLE_END(ts, INTERVAL '5' SECOND) AS window_end,
position AS position,
sum(num) AS sumNum
from sourceTable
where num > 5
group by TUMBLE(ts, INTERVAL '5' SECOND), position
having sum(num) < 20;
```
- More examples can be found [here](docs/sql_example.md).