gojumprope opened a new issue, #15166:
URL: https://github.com/apache/doris/issues/15166

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   1.2.0
   
   show variables like '%zone%';
   
   Variable_name   |Value  |
   ----------------+-------+
   system_time_zone|Etc/UTC|
   time_zone       |Etc/UTC|
   
   ### What's Wrong?
   
   when using kafka routine load to load timestamp data into datetime column, 
it does not follow system time zone to insert correct date time. Seems like it 
auto convert time to local time GMT +08:00 instead of UTC
   
   ### What You Expected?
   
   kafka routine load should load correct datetime follow by the timezone
   
   ### How to Reproduce?
   
   CREATE TABLE `table_test_12345` (
      `Id` varchar(21844),
      `DataTimestamp` varchar(21844),
      `__time` datetime
   )
   DISTRIBUTED BY HASH(id, __time) BUCKETS 32
   PROPERTIES (
     "replication_allocation" = "tag.location.default: 1"
   );
   
   
   CREATE ROUTINE LOAD dbo.routine_load_test_12345 ON table_test_12345 COLUMNS 
TERMINATED BY ",",
   COLUMNS (
        Id, DataTimestamp, __time = from_unixtime(DataTimestamp/1000)
   )
     PROPERTIES (
       "max_batch_interval" = "20",
       "max_batch_rows" = "300000",
       "max_batch_size" = "209715200",
       "format" = "json",
       "jsonpaths" = "[\"$.Id\",\"$.DataTimestamp\"]",
        "timezone" = "Etc/UTC"
       )
   FROM
     KAFKA (
       "kafka_broker_list" = "xx.xx.xx.xx:9092",
       "kafka_topic" = "kafka-routine-load-test",
       "property.kafka_default_offsets" = "OFFSET_BEGINNING",
       "property.isolation.level" = "read_committed"
   );
   
   
   select * from table_test_12345;
   
   Id   |DataTimestamp|__time             |
   -----+-------------+-------------------+
   12345|1671259505000|2022-12-17 14:45:05|
   
   
   correct one should be 
   Id   |DataTimestamp|__time             |
   -----+-------------+-------------------+
   12345|1671259505000|2022-12-17 06:45:05|
   
   ### Anything Else?
   
   If direct insert data from query then no issue.
   
   INSERT INTO table_test_12345
   VALUES('12345', '1671259505000', from_unixtime(1671259505000/1000));
   
   select * from table_test_12345;
   
   Id   |DataTimestamp|__time             |
   -----+-------------+-------------------+
   12345|1671259505000|2022-12-17 06:45:05|
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to