Skip to content

Commit

Permalink
[Feature] use system timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
liunaijie committed Sep 6, 2023
1 parent fa5b96c commit c5063da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.nio.file.Path;

@DisabledOnContainer(
value = {TestContainerId.FLINK_1_13, TestContainerId.FLINK_1_16},
value = {TestContainerId.FLINK_1_13},
disabledReason = "Paimon does not support flink 1.13")
public class PaimonIT extends TestSuiteBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.ZoneId;
import java.util.List;

public class AvroToRowConverter implements Serializable {
Expand Down Expand Up @@ -120,7 +120,7 @@ private Object convertField(SeaTunnelDataType<?> dataType, Schema.Field field, O
return LocalDate.ofEpochDay((Long) val);
case TIMESTAMP:
return LocalDateTime.ofInstant(
Instant.ofEpochMilli((Long) val), ZoneOffset.of("+8"));
Instant.ofEpochMilli((Long) val), ZoneId.systemDefault());
case ROW:
SeaTunnelRowType subRow = (SeaTunnelRowType) dataType;
return converter((GenericRecord) val, subRow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.nio.ByteBuffer;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -221,7 +221,7 @@ private Object resolveObject(Object data, SeaTunnelDataType<?> seaTunnelDataType
return recordBuilder.build();
case TIMESTAMP:
LocalDateTime dateTime = (LocalDateTime) data;
return (dateTime).toInstant(ZoneOffset.of("+8")).toEpochMilli();
return (dateTime).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
default:
String errorMsg =
String.format(
Expand Down

0 comments on commit c5063da

Please sign in to comment.