You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by je...@apache.org on 2019/03/25 16:46:59 UTC

[incubator-pinot] branch orcMV updated: Addressing comments

This is an automated email from the ASF dual-hosted git repository.

jenniferdai pushed a commit to branch orcMV
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/orcMV by this push:
     new 2357d85  Addressing comments
2357d85 is described below

commit 2357d85b6b602c3f827202935035a42b8dc1c8d1
Author: Jennifer Dai <jd...@linkedin.com>
AuthorDate: Mon Mar 25 09:46:46 2019 -0700

    Addressing comments
---
 .../java/org/apache/pinot/orc/data/readers/ORCRecordReader.java   | 5 +----
 .../org/apache/pinot/orc/data/readers/ORCRecordReaderTest.java    | 8 +++-----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/pinot-orc/src/main/java/org/apache/pinot/orc/data/readers/ORCRecordReader.java b/pinot-orc/src/main/java/org/apache/pinot/orc/data/readers/ORCRecordReader.java
index 07717e0..79d3189 100644
--- a/pinot-orc/src/main/java/org/apache/pinot/orc/data/readers/ORCRecordReader.java
+++ b/pinot-orc/src/main/java/org/apache/pinot/orc/data/readers/ORCRecordReader.java
@@ -66,7 +66,6 @@ public class ORCRecordReader implements RecordReader {
   Reader _reader;
   org.apache.orc.RecordReader _recordReader;
   VectorizedRowBatch _reusableVectorizedRowBatch;
-  OrcMapredRecordReader _orcMapredRecordReader;
 
   public static final String LOCAL_FS_PREFIX = "file://";
 
@@ -87,8 +86,6 @@ public class ORCRecordReader implements RecordReader {
         LOGGER.warn("Pinot schema is not set in segment generator config");
       }
       _recordReader = _reader.rows(_reader.options().schema(_orcSchema));
-
-      _orcMapredRecordReader = new OrcMapredRecordReader<>(_recordReader, _orcSchema);
     } catch (Exception e) {
       LOGGER.error("Caught exception initializing record reader at path {}", inputPath);
       throw new RuntimeException(e);
@@ -193,7 +190,7 @@ public class ORCRecordReader implements RecordReader {
   }
 
   private List<Object> translateList(OrcList<? extends WritableComparable> l) {
-    if (l == null || l.size() < 1) {
+    if (l == null || l.isEmpty()) {
       return ImmutableList.of();
     }
 
diff --git a/pinot-orc/src/test/java/org/apache/pinot/orc/data/readers/ORCRecordReaderTest.java b/pinot-orc/src/test/java/org/apache/pinot/orc/data/readers/ORCRecordReaderTest.java
index 3dcdc98..f63aa9f 100644
--- a/pinot-orc/src/test/java/org/apache/pinot/orc/data/readers/ORCRecordReaderTest.java
+++ b/pinot-orc/src/test/java/org/apache/pinot/orc/data/readers/ORCRecordReaderTest.java
@@ -86,17 +86,17 @@ public class ORCRecordReaderTest {
 
     // Define the mv orc schema - TypeDescription
     TypeDescription orcTypeDesc = TypeDescription.createStruct();
-    orcTypeDesc.addField("emails", TypeDescription.createList(TypeDescription.createString()));
-
     TypeDescription typeEmails = TypeDescription.createList(TypeDescription.createString());
 
+    orcTypeDesc.addField("emails", typeEmails);
+
     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));
@@ -104,7 +104,6 @@ public class ORCRecordReaderTest {
     OrcMapredRecordWriter mrRecordWriter = new OrcMapredRecordWriter(mvWriter);
     mrRecordWriter.write(null, struct);
     mrRecordWriter.close(null);
-    System.out.println();
   }
 
   @Test
@@ -159,7 +158,6 @@ public class ORCRecordReaderTest {
     Assert.assertTrue(l.size() == 2);
     Assert.assertEquals(l.get(0), "hello");
     Assert.assertEquals(l.get(1), "no");
-
   }
 
   @AfterClass


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