Closed
Description
Steps to reproduce the behavior (Required)
- zone set
SET global time_zone = '+0:00';
SHOW VARIABLES LIKE '%time_zone%';
+------------------+---------------+
| Variable_name | Value |
+------------------+---------------+
| system_time_zone | Asia/Shanghai |
| time_zone | +00:00 |
+------------------+---------------+
- create table
create table if not exists test.test_details(
id bigint not null,
name string,
str_default1 string default '',
str_default2 string default 'a',
int_default1 bigint default '0',
int_default2 bigint default '1',
datetime_default1 datetime default '1970-01-01 00:00:00',
datetime_default2 datetime default current_timestamp
)
DUPLICATE KEY(id)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES (
"replication_num" = "1"
);
- insert sql way
insert into test.test_details(id, name) values
(1, 'name1'),
(2, 'name2')
;
+------+-------+--------------+--------------+--------------+--------------+---------------------+---------------------+
| id | name | str_default1 | str_default2 | int_default1 | int_default2 | datetime_default1 | datetime_default2 |
+------+-------+--------------+--------------+--------------+--------------+---------------------+---------------------+
| 1 | name1 | | a | 0 | 1 | 1970-01-01 00:00:00 | 2024-11-07 06:09:21 |
| 2 | name2 | | a | 0 | 1 | 1970-01-01 00:00:00 | 2024-11-07 06:09:21 |
+------+-------+--------------+--------------+--------------+--------------+---------------------+---------------------+
- stream load way
curl --location-trusted -u root: -T test_details.json -H "format:json" -H "columns:id,name" http://127.0.0.1:8061/api/test/test_details/_stream_load
+------+-------+--------------+--------------+--------------+--------------+---------------------+---------------------+
| id | name | str_default1 | str_default2 | int_default1 | int_default2 | datetime_default1 | datetime_default2 |
+------+-------+--------------+--------------+--------------+--------------+---------------------+---------------------+
| 1 | name1 | | a | 0 | 1 | 1970-01-01 00:00:00 | 2024-11-07 14:10:58 |
| 2 | name2 | | a | 0 | 1 | 1970-01-01 00:00:00 | 2024-11-07 14:10:58 |
+------+-------+--------------+--------------+--------------+--------------+---------------------+---------------------+
Expected behavior (Required)
datetime_default2 column store the current UTC time
Real behavior (Required)
datetime_default2 column store the current Asia/Shanghai time when use stream load way
StarRocks version (Required)
3.3.4-56bcf6f