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 510bf8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 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,8 @@ 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 @@ -221,7 +221,9 @@ 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)
.toInstant(ZoneOffset.of(ZoneOffset.systemDefault().getId()))
.toEpochMilli();
default:
String errorMsg =
String.format(
Expand Down

0 comments on commit 510bf8f

Please sign in to comment.