You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shp1570 17 hours ago
PARTITION BY RANGE(date, id)
(
PARTITION p201701_1000 VALUES LESS THAN ("2017-02-01", "1000"),
PARTITION p201702_2000 VALUES LESS THAN ("2017-03-01", "2000"),
PARTITION p201703_all VALUES LESS THAN ("2017-04-01")
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Discussion options
shp1570
17 hours ago
PARTITION BY RANGE(date, id)
(
PARTITION p201701_1000 VALUES LESS THAN ("2017-02-01", "1000"),
PARTITION p201702_2000 VALUES LESS THAN ("2017-03-01", "2000"),
PARTITION p201703_all VALUES LESS THAN ("2017-04-01")
)
在以上示例中,我们指定 date(DATE 类型) 和 id(INT 类型) 作为分区列。以上示例最终得到的分区如下:
p201701_1000: [(MIN_VALUE, MIN_VALUE), ("2017-02-01", "1000") )
p201702_2000: [("2017-02-01", "1000"), ("2017-03-01", "2000") )
p201703_all: [("2017-03-01", "2000"), ("2017-04-01", MIN_VALUE))
数据 --> 分区
2017-01-01, 200 --> p201701_1000
2017-01-01, 2000 --> p201701_1000
2017-02-01, 100 --> p201701_1000
2017-02-01, 2000 --> p201702_2000
2017-02-15, 5000 --> p201702_2000
2017-03-01, 2000 --> p201703_all
2017-03-10, 1 --> p201703_all
2017-04-01, 1000 --> 无法导入
2017-05-01, 1000 --> 无法导入
文档给出的用例,和建表指定的分区,看不出来对应关系,看完不知道多列分区怎么用
Beta Was this translation helpful? Give feedback.
All reactions