> On Sept. 16, 2014, 4:46 a.m., Aditya Kishore wrote:
> > exec/java-exec/src/main/java/parquet/hadoop/CodecFactoryExposer.java, lines
> > 75-90
> > <https://reviews.apache.org/r/25674/diff/1/?file=690072#file690072line75>
> >
> > For brevity, please consider this. In the current form, some of the
> > variable have larger scope than required.
> >
> > ```java
> > if(DirectDecompressionCodec.class.isAssignableFrom(cx)) {
> > DirectDecompressor decompr =
> > ((DirectDecompressionCodec)c).createDirectDecompressor();
> > decompr.decompress(inpBuffer, outBuffer);
> > ```
> >
> > Also, is it possible to create the ```DirectDecompressor``` once and
> > reuse it?
Pulling the decompr variable into the if condition creates two code paths in
which the decompressor has to use the 'slow' path. So the code actually gets
more verbose:
<code>
if (DirectDecompressionCodec.class.isAssignableFrom(cx)) {
d=(DirectDecompressionCodec)c;
}
if(d!=null) {
decompr = d.createDirectDecompressor();
if(decompr!=null){
decompr.decompress(inpBuffer, outBuffer);
}else{
Use_slow_decompression_path
}
}else{
Use_slow_decompression_path
}
</code>
It is possible to create a DirectDecompressor and reuse it, but the code
changes are turning out to be a little more complex than I initially thought.
I've added a TODO and we should probably fix this when we do our next round of
refactoring.
- Parth
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25674/#review53464
-----------------------------------------------------------
On Sept. 15, 2014, 11:10 p.m., Parth Chandra wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25674/
> -----------------------------------------------------------
>
> (Updated Sept. 15, 2014, 11:10 p.m.)
>
>
> Review request for drill.
>
>
> Repository: drill-git
>
>
> Description
> -------
>
> DRILL-1368: NPE while reading from Gzip compressed Parquet file
>
>
> Diffs
> -----
>
> exec/java-exec/src/main/java/parquet/hadoop/CodecFactoryExposer.java
> d6584bb
>
> Diff: https://reviews.apache.org/r/25674/diff/
>
>
> Testing
> -------
>
> Tested with Gzip file on Mac (where Gzip decompression is not supported) and
> checked the results.
>
>
> Thanks,
>
> Parth Chandra
>
>