shangxinli commented on a change in pull request #778:
URL: https://github.com/apache/parquet-mr/pull/778#discussion_r422563108



##########
File path: 
parquet-avro/src/test/java/org/apache/parquet/avro/TestAvroSchemaConverter.java
##########
@@ -766,6 +768,33 @@ public void testReuseNameInNestedStructureAtSameLevel() 
throws Exception {
     testParquetToAvroConversion(NEW_BEHAVIOR, schema, parquetSchema);
   }
 
+  @Test
+  public void testUUIDType() throws Exception {
+    Schema fromAvro = Schema.createRecord("myrecord", null, null, false,
+        Arrays.asList(new Schema.Field("uuid", 
LogicalTypes.uuid().addToSchema(Schema.create(STRING)), null, null)));
+    String parquet = "message myrecord {\n" +
+        "  required binary uuid (STRING);\n" +
+        "}\n";
+    Schema toAvro = Schema.createRecord("myrecord", null, null, false,
+        Arrays.asList(new Schema.Field("uuid", Schema.create(STRING), null, 
null)));
+
+    testAvroToParquetConversion(fromAvro, parquet);
+    testParquetToAvroConversion(toAvro, parquet);
+  }

Review comment:
       Basically we found some type of avro schema is not compatible with the 
parquet schema which it is converted to. This caused problem that the data 
cannot be read. I have a test here 
(https://github.com/shangxinli/parquet-mr/commit/f80469f55b83404ea334ee4019f658ecdb5ac575#diff-536ca67880a7870cf8df8f95143bd7d7R814)
 that reproduce the issue for a nested schema. I know likely UUID type won't 
have this issue but I better to have a test for it. It is pretty easy to add 
also.  




----------------------------------------------------------------
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.

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


Reply via email to