mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-01 04:40:39 +00:00
* fix: simp expr recursively Signed-off-by: discord9 <discord9@163.com> * test: some simple constant folding case Signed-off-by: discord9 <discord9@163.com> * fix: literal ts cast to UTC Signed-off-by: discord9 <discord9@163.com> * fix: patch merge scan batch col tz instead Signed-off-by: discord9 <discord9@163.com> * test: fix Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com>
72 lines
2.2 KiB
Plaintext
72 lines
2.2 KiB
Plaintext
CREATE TABLE ngx_access_log (
|
|
client STRING,
|
|
country STRING,
|
|
access_time TIMESTAMP TIME INDEX
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
/* insert some data */
|
|
INSERT INTO
|
|
ngx_access_log
|
|
VALUES
|
|
("client1", "US", "2022-01-01 00:00:00"),
|
|
("client2", "US", "2022-01-01 00:00:01"),
|
|
("client3", "UK", "2022-01-01 00:00:02"),
|
|
("client4", "UK", "2022-01-01 00:00:03"),
|
|
("client5", "CN", "2022-01-01 00:00:04"),
|
|
("client6", "CN", "2022-01-01 00:00:05"),
|
|
("client7", "JP", "2022-01-01 00:00:06"),
|
|
("client8", "JP", "2022-01-01 00:00:07"),
|
|
("client9", "KR", "2022-01-01 00:00:08"),
|
|
("client10", "KR", "2022-01-01 00:00:09");
|
|
|
|
Affected Rows: 10
|
|
|
|
-- should not fail with mismatch timezone
|
|
-- SQLNESS REPLACE \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{9}Z NOW
|
|
SELECT
|
|
now()
|
|
FROM
|
|
ngx_access_log;
|
|
|
|
+--------------------------------+
|
|
| now() |
|
|
+--------------------------------+
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
| NOW |
|
|
+--------------------------------+
|
|
|
|
-- SQLNESS REPLACE TimestampNanosecond\(\d+ TimestampNanosecond(NOW
|
|
-- SQLNESS REPLACE (peers.*) REDACTED
|
|
-- SQLNESS REPLACE (partitioning.*) REDACTED
|
|
EXPLAIN SELECT
|
|
now()
|
|
FROM
|
|
ngx_access_log;
|
|
|
|
+---------------+-------------------------------------------------------------------------------+
|
|
| plan_type | plan |
|
|
+---------------+-------------------------------------------------------------------------------+
|
|
| logical_plan | MergeScan [is_placeholder=false, remote_input=[ |
|
|
| | Projection: TimestampNanosecond(NOW, Some("+00:00")) AS now() |
|
|
| | TableScan: ngx_access_log |
|
|
| | ]] |
|
|
| physical_plan | CooperativeExec |
|
|
| | MergeScanExec: REDACTED
|
|
| | |
|
|
+---------------+-------------------------------------------------------------------------------+
|
|
|
|
DROP TABLE ngx_access_log;
|
|
|
|
Affected Rows: 0
|
|
|