parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [parquet-mr] branch master updated: PARQUET-1682: Maintain forward compatibility for TIME/TIMESTAMP (#694)
Date Tue, 22 Oct 2019 13:24:29 GMT
This is an automated email from the ASF dual-hosted git repository.

gabor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-mr.git


The following commit(s) were added to refs/heads/master by this push:
     new 2117abc  PARQUET-1682: Maintain forward compatibility for TIME/TIMESTAMP (#694)
2117abc is described below

commit 2117abcbd0ae316169e7f66655e0d202553bd290
Author: Gabor Szadovszky <gabor@apache.org>
AuthorDate: Tue Oct 22 15:24:20 2019 +0200

    PARQUET-1682: Maintain forward compatibility for TIME/TIMESTAMP (#694)
---
 .../java/org/apache/parquet/schema/LogicalTypeAnnotation.java     | 6 ------
 .../apache/parquet/format/converter/ParquetMetadataConverter.java | 6 ------
 .../parquet/format/converter/TestParquetMetadataConverter.java    | 8 ++++----
 3 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java
b/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java
index 4472376..5f61ed6 100644
--- a/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java
+++ b/parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java
@@ -555,9 +555,6 @@ public abstract class LogicalTypeAnnotation {
     @Override
     @InterfaceAudience.Private
     public OriginalType toOriginalType() {
-      if (!isAdjustedToUTC) {
-        return null;
-      }
       switch (unit) {
         case MILLIS:
           return OriginalType.TIME_MILLIS;
@@ -637,9 +634,6 @@ public abstract class LogicalTypeAnnotation {
     @Override
     @InterfaceAudience.Private
     public OriginalType toOriginalType() {
-      if (!isAdjustedToUTC) {
-        return null;
-      }
       switch (unit) {
         case MILLIS:
           return OriginalType.TIMESTAMP_MILLIS;
diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
b/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
index deeda65..b01e73c 100644
--- a/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
+++ b/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
@@ -309,9 +309,6 @@ public class ParquetMetadataConverter {
 
     @Override
     public Optional<ConvertedType> visit(LogicalTypeAnnotation.TimeLogicalTypeAnnotation
timeLogicalType) {
-      if (!timeLogicalType.isAdjustedToUTC()) {
-        return empty();
-      }
       switch (timeLogicalType.getUnit()) {
         case MILLIS:
           return of(ConvertedType.TIME_MILLIS);
@@ -326,9 +323,6 @@ public class ParquetMetadataConverter {
 
     @Override
     public Optional<ConvertedType> visit(LogicalTypeAnnotation.TimestampLogicalTypeAnnotation
timestampLogicalType) {
-      if (!timestampLogicalType.isAdjustedToUTC()) {
-        return empty();
-      }
       switch (timestampLogicalType.getUnit()) {
         case MICROS:
           return of(ConvertedType.TIMESTAMP_MICROS);
diff --git a/parquet-hadoop/src/test/java/org/apache/parquet/format/converter/TestParquetMetadataConverter.java
b/parquet-hadoop/src/test/java/org/apache/parquet/format/converter/TestParquetMetadataConverter.java
index 65244f4..5da5ddf 100644
--- a/parquet-hadoop/src/test/java/org/apache/parquet/format/converter/TestParquetMetadataConverter.java
+++ b/parquet-hadoop/src/test/java/org/apache/parquet/format/converter/TestParquetMetadataConverter.java
@@ -269,15 +269,15 @@ public class TestParquetMetadataConverter {
     assertEquals(ConvertedType.TIMESTAMP_MILLIS, parquetMetadataConverter.convertToConvertedType(timestampType(true,
MILLIS)));
     assertEquals(ConvertedType.TIMESTAMP_MICROS, parquetMetadataConverter.convertToConvertedType(timestampType(true,
MICROS)));
     assertNull(parquetMetadataConverter.convertToConvertedType(timestampType(true, NANOS)));
-    assertNull(parquetMetadataConverter.convertToConvertedType(timestampType(false, MILLIS)));
-    assertNull(parquetMetadataConverter.convertToConvertedType(timestampType(false, MICROS)));
+    assertEquals(ConvertedType.TIMESTAMP_MILLIS, parquetMetadataConverter.convertToConvertedType(timestampType(false,
MILLIS)));
+    assertEquals(ConvertedType.TIMESTAMP_MICROS, parquetMetadataConverter.convertToConvertedType(timestampType(false,
MICROS)));
     assertNull(parquetMetadataConverter.convertToConvertedType(timestampType(false, NANOS)));
 
     assertEquals(ConvertedType.TIME_MILLIS, parquetMetadataConverter.convertToConvertedType(timeType(true,
MILLIS)));
     assertEquals(ConvertedType.TIME_MICROS, parquetMetadataConverter.convertToConvertedType(timeType(true,
MICROS)));
     assertNull(parquetMetadataConverter.convertToConvertedType(timeType(true, NANOS)));
-    assertNull(parquetMetadataConverter.convertToConvertedType(timeType(false, MILLIS)));
-    assertNull(parquetMetadataConverter.convertToConvertedType(timeType(false, MICROS)));
+    assertEquals(ConvertedType.TIME_MILLIS, parquetMetadataConverter.convertToConvertedType(timeType(false,
MILLIS)));
+    assertEquals(ConvertedType.TIME_MICROS, parquetMetadataConverter.convertToConvertedType(timeType(false,
MICROS)));
     assertNull(parquetMetadataConverter.convertToConvertedType(timeType(false, NANOS)));
 
     assertEquals(ConvertedType.DATE, parquetMetadataConverter.convertToConvertedType(dateType()));


Mime
View raw message