Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current_timestamp zone invalid when use stream load way #52691

Open
lukoou3 opened this issue Nov 7, 2024 · 0 comments
Open

current_timestamp zone invalid when use stream load way #52691

lukoou3 opened this issue Nov 7, 2024 · 0 comments
Labels
type/bug Something isn't working

Comments

@lukoou3
Copy link

lukoou3 commented Nov 7, 2024

Steps to reproduce the behavior (Required)

  1. 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        |
+------------------+---------------+
  1. 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"
);
  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 |
+------+-------+--------------+--------------+--------------+--------------+---------------------+---------------------+

  1. 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

@lukoou3 lukoou3 added the type/bug Something isn't working label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant