You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/03/25 13:36:58 UTC

[GitHub] [incubator-pinot] sunithabeeram commented on a change in pull request #4009: Adding ORC Multi-value Column Support

sunithabeeram commented on a change in pull request #4009: Adding ORC Multi-value Column Support
URL: https://github.com/apache/incubator-pinot/pull/4009#discussion_r268641325
 
 

 ##########
 File path: pinot-orc/src/test/java/org/apache/pinot/orc/data/readers/ORCRecordReaderTest.java
 ##########
 @@ -77,12 +83,33 @@ public void setUp()
       writer.addRowBatch(batch);
     }
     writer.close();
+
+    // Define the mv orc schema - TypeDescription
+    TypeDescription orcTypeDesc = TypeDescription.createStruct();
+    orcTypeDesc.addField("emails", TypeDescription.createList(TypeDescription.createString()));
+
+    TypeDescription typeEmails = TypeDescription.createList(TypeDescription.createString());
+
+    OrcList<Text> emails = new OrcList<>(typeEmails);
+    emails.add(new Text("hello"));
+    emails.add(new Text("no"));
+
+    OrcStruct struct = new OrcStruct(orcTypeDesc);
+    struct.setFieldValue("emails", emails);
+
+    Writer mvWriter = OrcFile.createWriter(new Path(MULTIVALUE_ORC_FILE.getAbsolutePath()),
+        OrcFile.writerOptions(new Configuration())
+            .setSchema(orcTypeDesc));
+
+    OrcMapredRecordWriter mrRecordWriter = new OrcMapredRecordWriter(mvWriter);
+    mrRecordWriter.write(null, struct);
+    mrRecordWriter.close(null);
+    System.out.println();
 
 Review comment:
   Remove.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org