orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Citrullin <...@git.apache.org>
Subject [GitHub] orc pull request #104: Core documentation fixes
Date Thu, 13 Apr 2017 20:20:46 GMT
Github user Citrullin commented on a diff in the pull request:

    https://github.com/apache/orc/pull/104#discussion_r111478051
  
    --- Diff: site/_docs/core-java.md ---
    @@ -233,14 +233,15 @@ VectorizedRowBatch batch = schema.createRowBatch();
     LongColumnVector x = (LongColumnVector) batch.cols[0];
     LongColumnVector y = (LongColumnVector) batch.cols[1];
     for(int r=0; r < 10000; ++r) {
    -  int row = batch.size++;
    +  int row = batch.size;
       x.vector[row] = r;
    --- End diff --
    
    Hi, I'm not that good in Java. I'm more familiar with Scala. But you take a look into
the Library I wrote. I created two branches where I changed only the position of the up counting.
    
    In example-1 I count both batch.size and rowBatchSize up before I add a row to VectorizedBatch.

    [See more here](https://github.com/Citrullin/scalaOrcWriter/blob/ORC-168-wrong-example-1/src/main/scala/citrullin/orcwriter/OrcWriter.scala#L77)
    
    In example 2 I count only batch.size up before I add the row to the batch. rowBatchSize
will up counted after a row is written.
    [See more here](https://github.com/Citrullin/scalaOrcWriter/blob/ORC-168-wrong-example-2/src/main/scala/citrullin/orcwriter/OrcWriter.scala#L77)
    
    The working example is in the dev branch. 
    [More here](https://github.com/Citrullin/scalaOrcWriter/blob/dev/src/main/scala/citrullin/orcwriter/OrcWriter.scala#L77)
    
    You can run the Implicit ComplexMap example to see the differences. 
    [Here is the source](https://github.com/Citrullin/scalaOrcWriter/blob/dev/src/main/scala/citrullin/orcwriter/examples/orcwriterimplicitapi/WriteComplexMap.scala)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message