cxzl25 commented on issue #1061:
URL: https://github.com/apache/orc/issues/1061#issuecomment-3077174048

   > Do you mean the following is related and insufficient also?
   
   I have read the implementation of 
[ORC-1075](https://issues.apache.org/jira/browse/ORC-1075) that has fixed this 
issue. 
   
   Thank you @dongjoon-hyun !
   
   I think this issue can be closed.
   
   ---
   
   I wrote a UT that passes the test.
   
   org.apache.orc.impl.TestRecordReaderImpl
   ```java
     @Test
     public void testStringStatisticsWithPrestoWriter() throws Exception {
       // struct<id:int,name:string,score:int>
       Path testFilePath = new Path(workDir, "orc-file-presto-string.orc");
       FileSystem fs = FileSystem.get(conf);
   
       Reader reader = OrcFile.createReader(testFilePath,
           OrcFile.readerOptions(conf).filesystem(fs));
   
       try (RecordReader rr = reader.rows()) {
         RecordReaderImpl rri = (RecordReaderImpl) rr;
         // x.z id is 2, We just need to read this column
         OrcIndex orcIndex = rri.readRowIndex(0,
             new boolean[] { false, false, true, false },
             new boolean[] { false, false, true, false });
         OrcProto.RowIndex[] rowGroupIndex = orcIndex.getRowGroupIndex();
         OrcProto.ColumnStatistics statistics = 
rowGroupIndex[2].getEntry(0).getStatistics();
         OrcProto.ColumnEncoding encoding = OrcProto.ColumnEncoding.newBuilder()
             .setKind(OrcProto.ColumnEncoding.Kind.DIRECT_V2)
             .build();
         PredicateLeaf pred = createPredicateLeaf(
             PredicateLeaf.Operator.IS_NULL, PredicateLeaf.Type.STRING, "name", 
null, null);
   
         TruthValue truthValue = RecordReaderImpl.evaluatePredicateProto(
             statistics,
             pred, null, encoding, null,
             CURRENT_WRITER, TypeDescription.createString());
   
         assertEquals(TruthValue.YES_NO_NULL, truthValue);
       }
     }
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to