Skip to content

Commit 93e368a

Browse files
authored
parquet reader
1 parent 9bea34e commit 93e368a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

parquet.java.snippet

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<dependency>
2+
<groupId>org.apache.parquet</groupId>
3+
<artifactId>parquet-avro</artifactId>
4+
<exclusions>
5+
<exclusion>
6+
<groupId>org.apache.commons</groupId>
7+
<artifactId>commons-compress</artifactId>
8+
</exclusion>
9+
<exclusion>
10+
<groupId>it.unimi.dsi</groupId>
11+
<artifactId>fastutil</artifactId>
12+
</exclusion>
13+
<exclusion>
14+
<groupId>org.tukaani</groupId>
15+
<artifactId>xz</artifactId>
16+
</exclusion>
17+
<exclusion>
18+
<groupId>com.thoughtworks.paranamer</groupId>
19+
<artifactId>paranamer</artifactId>
20+
</exclusion>
21+
</exclusions>
22+
</dependency>
23+
24+
25+
import org.apache.avro.generic.GenericData;
26+
import org.apache.hadoop.fs.Path;
27+
import org.apache.parquet.avro.AvroParquetReader;
28+
import org.apache.parquet.hadoop.ParquetReader;
29+
30+
31+
try (ParquetReader parquetReader = AvroParquetReader.builder(new Path(fullPathTofile)).build()) {
32+
33+
for (GenericData.Record record = (GenericData.Record) parquetReader.read(); record != null; record = (GenericData.Record) parquetReader.read()) {

0 commit comments

Comments
 (0)