-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
783 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## SQL Parser | ||
### SQL SYNTAX | ||
#### PARTITION | ||
We support three kinds of partitions. | ||
1. Range partition. | ||
2. List partition. | ||
3. Hash partition. | ||
##### RANGE PARTITION | ||
```sql | ||
CREATE TABLE orders_range | ||
( | ||
id INT PRIMARY KEY, | ||
name VARCHAR(30), | ||
order_date DATE, | ||
) PARTITION BY RANGE(id) | ||
( | ||
p0 VALUES LESS THAN (5), | ||
p1 VALUES LESS THAN (10), | ||
p2 VALUES LESS THAN (15), | ||
p3 VALUES LESS THAN (MAXVALUE) | ||
); | ||
``` | ||
##### LIST PARTITION | ||
```sql | ||
CREATE TABLE orders_range | ||
( | ||
id INT PRIMARY KEY, | ||
name VARCHAR(30), | ||
order_date DATE, | ||
) PARTITION BY LIST(id) | ||
( | ||
p0 VALUES IN (1, 2, 3), | ||
p1 VALUES IN (4, 5), | ||
p2 VALUES IN (8, 9, 10) | ||
); | ||
``` | ||
##### HASH PARTITION | ||
```sql | ||
CREATE TABLE orders_range | ||
( | ||
id INT PRIMARY KEY, | ||
name VARCHAR(30), | ||
order_date DATE, | ||
) PARTITION BY HASH(id) PARTITIONS 4; | ||
``` |
Oops, something went wrong.