apache / apache/parquet-java

Pure Java NIO LocalInputFile Implementation

オープン
#3,028 コメント 1 件 リアクション 3 件 担当者 0 名 GitHub で見る
Type: enhancement
主要言語
Java
スター
3.1k
フォーク
1.6k
平均マージ
3日 12時間
マージ済み PR(30日)
33

説明

### Describe the enhancement requested

Hi there!

In an effort to reduce our coupling to Hadoop, and slim down our shaded Jar sizes, we transitioned all our Parquet reading / writing to using the non-Hadoop public interfaces. We leveraged Java NIO interfaces for reading / writing I/O, as detailed in this blog post here: https://blakesmith.me/2024/10/05/how-to-use-parquet-java-without-hadoop.html

The problem we hit: The current `LocalInputFile` implementation [falls back to Path#toFile and RandomAccessFile](https://github.com/apache/parquet-java/blob/master/parquet-common/src/main/java/org/apache/parquet/io/LocalInputFile.java#L42) calls for I/O operations. Once we plug in other `java.nio.file.FileSystem` implementations ([Such as using AWS' Java NIO SPI implementation](https://github.com/awslabs/aws-java-nio-spi-for-s3/)), the `LocalInputFile` implementation doesn't work anymore.

We've created our own implementation of `LocalInputFile` called `NioInputFile`, that implements the interface, but exclusively using Java NIO operations, instead of falling back to older Java file APIs. You can see the code in the above linked blog post, and also in this gist here: https://gist.github.com/blakesmith/5c08a2504c08c96f9fb62658ec6c9b28

A few questions, before I start sending patches:

1. Is this alternative implementation something that folks are interested in incorporating upstream into Parquet itself?
2. If so, would we prefer to update `LocalInputFile`, or add `NioInputFile` as another implementation of `LocalInputFile`? Note that in our case, we're doing buffered I/O to S3 with this implementation, so it's not technically a "local" file, either way, just one that talks to the Java NIO abstractions.

Of note is that `LocalOutputFile` is working just fine with Java NIO operations, even when we're doing remote S3 I/O.

Thanks you so much! Parquet has been transformative for us, and we're excited to help drive more adoption however we can.

### Component(s)

Core

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Read parquet-common/src/main/java/org/apache/parquet/io/LocalInputFile.java and compare it with the NioInputFile implementation linked in the issue. Check how LocalOutputFile uses Java NIO, then clarify whether completion means updating LocalInputFile or adding a separate implementation that works with alternate FileSystem providers.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
backend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。