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-1335: Logical type names in parquet-mr are not consistent with parquet-format (#496)
Date Mon, 25 Jun 2018 06:24:18 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 33ee549  PARQUET-1335: Logical type names in parquet-mr are not consistent with parquet-format
(#496)
33ee549 is described below

commit 33ee5497490cbc97f3eabe9ef7a6391e4dbee8bc
Author: nandorKollar <nandorKollar@users.noreply.github.com>
AuthorDate: Mon Jun 25 08:24:15 2018 +0200

    PARQUET-1335: Logical type names in parquet-mr are not consistent with parquet-format
(#496)
---
 .../parquet/schema/LogicalTypeAnnotation.java      |  8 +++----
 .../apache/parquet/parser/TestParquetParser.java   | 26 +++++++++++-----------
 2 files changed, 17 insertions(+), 17 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 b91292b..340a24a 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
@@ -41,7 +41,7 @@ public abstract class LogicalTypeAnnotation {
         return listType();
       }
     },
-    UTF8 {
+    STRING {
       @Override
       protected LogicalTypeAnnotation fromString(List<String> params) {
         return stringType();
@@ -92,7 +92,7 @@ public abstract class LogicalTypeAnnotation {
         return timestampType(Boolean.parseBoolean(params.get(1)), TimeUnit.valueOf(params.get(0)));
       }
     },
-    INT {
+    INTEGER {
       @Override
       protected LogicalTypeAnnotation fromString(List<String> params) {
         if (params.size() != 2) {
@@ -277,7 +277,7 @@ public abstract class LogicalTypeAnnotation {
 
     @Override
     LogicalTypeToken getType() {
-      return LogicalTypeToken.UTF8;
+      return LogicalTypeToken.STRING;
     }
 
     @Override
@@ -650,7 +650,7 @@ public abstract class LogicalTypeAnnotation {
 
     @Override
     LogicalTypeToken getType() {
-      return LogicalTypeToken.INT;
+      return LogicalTypeToken.INTEGER;
     }
 
     @Override
diff --git a/parquet-column/src/test/java/org/apache/parquet/parser/TestParquetParser.java
b/parquet-column/src/test/java/org/apache/parquet/parser/TestParquetParser.java
index 5082501..1abd56a 100644
--- a/parquet-column/src/test/java/org/apache/parquet/parser/TestParquetParser.java
+++ b/parquet-column/src/test/java/org/apache/parquet/parser/TestParquetParser.java
@@ -47,7 +47,7 @@ import org.apache.parquet.schema.Types.MessageTypeBuilder;
 
 public class TestParquetParser {
   @Test
-  public void testPaperExample() throws Exception {
+  public void testPaperExample() {
     String example =
         "message Document {\n" +
         "  required int64 DocId;\n" +
@@ -122,7 +122,7 @@ public class TestParquetParser {
   public void testUTF8Annotation() {
     String message =
         "message StringMessage {\n" +
-        "  required binary string (UTF8);\n" +
+        "  required binary string (STRING);\n" +
         "}\n";
 
     MessageType parsed = parseMessageType(message);
@@ -139,7 +139,7 @@ public class TestParquetParser {
   public void testIDs() {
     String message =
         "message Message {\n" +
-        "  required binary string (UTF8) = 6;\n" +
+        "  required binary string (STRING) = 6;\n" +
         "  required int32 i=1;\n" +
         "  required binary s2= 3;\n" +
         "  required binary s3 =4;\n" +
@@ -165,7 +165,7 @@ public class TestParquetParser {
         "message Message {\n" +
         "  optional group aMap (MAP) {\n" +
         "    repeated group map (MAP_KEY_VALUE) {\n" +
-        "      required binary key (UTF8);\n" +
+        "      required binary key (STRING);\n" +
         "      required int32 value;\n" +
         "    }\n" +
         "  }\n" +
@@ -192,7 +192,7 @@ public class TestParquetParser {
     String message =
         "message Message {\n" +
         "  required group aList (LIST) {\n" +
-        "    repeated binary string (UTF8);\n" +
+        "    repeated binary string (STRING);\n" +
         "  }\n" +
         "}\n";
 
@@ -304,14 +304,14 @@ public class TestParquetParser {
   @Test
   public void testIntegerAnnotations() {
     String message = "message IntMessage {" +
-      "  required int32 i8 (INT(8,true));" +
-      "  required int32 i16 (INT(16,true));" +
-      "  required int32 i32 (INT(32,true));" +
-      "  required int64 i64 (INT(64,true));" +
-      "  required int32 u8 (INT(8,false));" +
-      "  required int32 u16 (INT(16,false));" +
-      "  required int32 u32 (INT(32,false));" +
-      "  required int64 u64 (INT(64,false));" +
+      "  required int32 i8 (INTEGER(8,true));" +
+      "  required int32 i16 (INTEGER(16,true));" +
+      "  required int32 i32 (INTEGER(32,true));" +
+      "  required int64 i64 (INTEGER(64,true));" +
+      "  required int32 u8 (INTEGER(8,false));" +
+      "  required int32 u16 (INTEGER(16,false));" +
+      "  required int32 u32 (INTEGER(32,false));" +
+      "  required int64 u64 (INTEGER(64,false));" +
       "}\n";
 
     MessageType parsed = MessageTypeParser.parseMessageType(message);


Mime
View raw message