aihuaxu commented on code in PR #3072:
URL: https://github.com/apache/parquet-java/pull/3072#discussion_r2011120803

##########
parquet-column/src/test/java/org/apache/parquet/parser/TestParquetParser.java:
##########
@@ -447,4 +449,30 @@ public void testEmbeddedAnnotations() {
     MessageType reparsed = 
MessageTypeParser.parseMessageType(parsed.toString());
     assertEquals(expected, reparsed);
   }
+
+  @Test
+  public void testVARIANTAnnotation() {
+      String message = "message Message {\n"
+          + "  required group aVariant (VARIANT) {\n"
+          + "     required binary metadata;\n"
+          + "     required binary value;\n"
+          + "  }\n"
+          + "}\n";
+
+    MessageType expected = buildMessage()
+        .requiredGroup()
+        .as(LogicalTypeAnnotation.variantType())
+        .required(BINARY)
+        .named("metadata")
+        .required(BINARY)
+        .named("value")
+        .named("aVariant")
+        .named("Message");
+
+      MessageType parsed = parseMessageType(message);

Review Comment:
   @rdblue  and @wgtmac  Do we still need to add variant to `OriginalType` in 
parquet-java? Right now this test would fail from parsing message type since 
variant is not in `OriginalType`.  
   
   We are still parsing with original type 
(https://github.com/apache/parquet-java/blob/master/parquet-column/src/main/java/org/apache/parquet/schema/MessageTypeParser.java#L124)
   
   >     OriginalType originalType = null;
   >     if (t.equalsIgnoreCase("(")) {
   >       originalType = OriginalType.valueOf(st.nextToken());
   >       childBuilder.as(originalType);
   >       check(st.nextToken(), ")", "original type ended by )", st);
   >       t = st.nextToken();
   >     }
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@parquet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@parquet.apache.org
For additional commands, e-mail: issues-h...@parquet.apache.org

Reply via email to