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 (#503)
Date Mon, 09 Jul 2018 08:10:27 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 e9e36cd  PARQUET-1335: Logical type names in parquet-mr are not consistent with parquet-format
(#503)
e9e36cd is described below

commit e9e36cdc44a68662885e35773187cca00d20239e
Author: nandorKollar <nandorKollar@users.noreply.github.com>
AuthorDate: Mon Jul 9 10:10:24 2018 +0200

    PARQUET-1335: Logical type names in parquet-mr are not consistent with parquet-format
(#503)
    
    Add test case for STRING annotation and revert UTF8 annotations removed in PR#496
---
 .../apache/parquet/parser/TestParquetParser.java   | 28 ++++++++++++++++++----
 1 file changed, 23 insertions(+), 5 deletions(-)

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 1abd56a..d853601 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
@@ -20,6 +20,7 @@ package org.apache.parquet.parser;
 
 import static org.apache.parquet.schema.LogicalTypeAnnotation.TimeUnit.MILLIS;
 import static org.apache.parquet.schema.LogicalTypeAnnotation.intType;
+import static org.apache.parquet.schema.LogicalTypeAnnotation.stringType;
 import static org.apache.parquet.schema.LogicalTypeAnnotation.timeType;
 import static org.apache.parquet.schema.LogicalTypeAnnotation.timestampType;
 import static org.junit.Assert.assertEquals;
@@ -119,7 +120,7 @@ public class TestParquetParser {
   }
 
   @Test
-  public void testUTF8Annotation() {
+  public void testSTRINGAnnotation() {
     String message =
         "message StringMessage {\n" +
         "  required binary string (STRING);\n" +
@@ -127,7 +128,7 @@ public class TestParquetParser {
 
     MessageType parsed = parseMessageType(message);
     MessageType expected = buildMessage()
-        .required(BINARY).as(UTF8).named("string")
+        .required(BINARY).as(stringType()).named("string")
         .named("StringMessage");
 
     assertEquals(expected, parsed);
@@ -136,10 +137,27 @@ public class TestParquetParser {
   }
 
   @Test
+  public void testUTF8Annotation() {
+    String message =
+      "message StringMessage {\n" +
+        "  required binary string (UTF8);\n" +
+        "}\n";
+
+    MessageType parsed = parseMessageType(message);
+    MessageType expected = buildMessage()
+      .required(BINARY).as(UTF8).named("string")
+      .named("StringMessage");
+
+    assertEquals(expected, parsed);
+    MessageType reparsed = parseMessageType(parsed.toString());
+    assertEquals(expected, reparsed);
+  }
+
+  @Test
   public void testIDs() {
     String message =
         "message Message {\n" +
-        "  required binary string (STRING) = 6;\n" +
+        "  required binary string (UTF8) = 6;\n" +
         "  required int32 i=1;\n" +
         "  required binary s2= 3;\n" +
         "  required binary s3 =4;\n" +
@@ -165,7 +183,7 @@ public class TestParquetParser {
         "message Message {\n" +
         "  optional group aMap (MAP) {\n" +
         "    repeated group map (MAP_KEY_VALUE) {\n" +
-        "      required binary key (STRING);\n" +
+        "      required binary key (UTF8);\n" +
         "      required int32 value;\n" +
         "    }\n" +
         "  }\n" +
@@ -192,7 +210,7 @@ public class TestParquetParser {
     String message =
         "message Message {\n" +
         "  required group aList (LIST) {\n" +
-        "    repeated binary string (STRING);\n" +
+        "    repeated binary string (UTF8);\n" +
         "  }\n" +
         "}\n";
 


Mime
View raw message