So, the error is a null pointer in a BytesColumnVector.vector[r] down in
one of the nested fields.

The relevant path through the schema looks like: struct -> list -> struct
-> struct -> string.

You could do something like:

VectorizedRowBatch batch = ...
for(int r = 0; r < batch.size; ++r) {
  System.out.println("Starting row " + r);
  for(int c=0; c < batch.cols.length; ++c) {
    System.out.println("Column " + c);
    // You'll get an exception on the broken field
    StringBuilder builder = new StringBuilder();
    batch.cols[c].stringifyValue(builder, r);
  }
}

.. Owen

On Fri, Oct 13, 2017 at 2:02 PM, Telco Phone <[email protected]> wrote:

> What is the best way to troubleshoot this kind of error?
>
> java.lang.NullPointerException
> at java.lang.System.arraycopy(Native Method)
> at org.apache.hadoop.io.Text.set(Text.java:225)
> at org.apache.orc.impl.StringRedBlackTree.add(StringRedBlackTree.java:62)
> at org.apache.orc.impl.WriterImpl$StringTreeWriter.
> writeBatch(WriterImpl.java:1459)
> at org.apache.orc.impl.WriterImpl$StructTreeWriter.
> writeFields(WriterImpl.java:2106)
> at org.apache.orc.impl.WriterImpl$StructTreeWriter.
> writeBatch(WriterImpl.java:2120)
> at org.apache.orc.impl.WriterImpl$ListTreeWriter.
> writeBatch(WriterImpl.java:2221)
> at org.apache.orc.impl.WriterImpl$StructTreeWriter.
> writeRootBatch(WriterImpl.java:2098)
> at org.apache.orc.impl.WriterImpl.addRowBatch(WriterImpl.java:2811)
> at com.sovrn.scratch.Scratch.main(Scratch.java:154)
>
>
> Line 154 is writer.addRowBatch(batch);
>
> I am not looking to have anyone fixe my current is but more on how do I
> setup the code base to quickly trouble shoot these kind of issue ?
>
> Is it my array code ? String ?
>
> The logic loop that I have the code in seems to work well but from time to
> time I will get the above.
>
> Thoughts ?
>
>
>

Reply via email to