create table failed with partition #5167
-
when i use the sql follow to create table: CREATE TABLE IF NOT EXISTS tbl_aaa (
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
code STRING NOT NULL,
amount DOUBLE,
PRIMARY KEY(code),
TIME INDEX(ts)
)
PARTITION ON COLUMNS (ts) (
ts < '2005-01-01 00:00:00',
ts >= '2025-01-01 00:00:00' AND ts < '2010-01-01 00:00:00',
ts >= '2010-01-01 00:00:00' AND ts < '2015-01-01 00:00:00',
ts >= '2015-01-01 00:00:00' AND ts < '2020-01-01 00:00:00',
ts >= '2020-01-01 00:00:00' AND ts < '2025-01-01 00:00:00',
ts >= '2025-01-01 00:00:00'
); and then greptimedb response the result: {
"code": 1004,
"error": "Unclosed value Timestamp(1735660800000::Millisecond) on column ts",
"execution_time_ms": 0
} Timestamp(1735660800000::Millisecond) is '2025-01-01 00:00:00' my db version is greptime-windows-amd64-pyo3-v0.11.0 |
Beta Was this translation helpful? Give feedback.
Answered by
killme2008
Dec 15, 2024
Replies: 1 comment 1 reply
-
The second rule is wrong:
It should be:
The complete SQL: CREATE TABLE IF NOT EXISTS tbl_aaa (
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
code STRING NOT NULL,
amount DOUBLE,
PRIMARY KEY(code),
TIME INDEX(ts)
)
PARTITION ON COLUMNS (ts) (
ts < '2005-01-01 00:00:00',
ts >= '2005-01-01 00:00:00' AND ts < '2010-01-01 00:00:00',
ts >= '2010-01-01 00:00:00' AND ts < '2015-01-01 00:00:00',
ts >= '2015-01-01 00:00:00' AND ts < '2020-01-01 00:00:00',
ts >= '2020-01-01 00:00:00' AND ts < '2025-01-01 00:00:00',
ts >= '2025-01-01 00:00:00'
); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
amythos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@amythos
The second rule is wrong:
It should be:
The complete SQL: