<dependency> <groupId>org.apache.parquet</groupId> <artifactId>parquet-column</artifactId> <version>${parquet.version}</version> </dependency> Configuration conf = new Configuration(); Path outputPath = new Path("output.parquet"); try (ParquetWriter writer = AvroParquetWriter.builder(outputPath) .withConf(conf) .withSchema(schema) .build()) { for (Record record : records) { writer.write(record); } } Configuration conf = new Configuration(); Path inputPath = new Path("input.parquet"); try (ParquetReader reader = AvroParquetReader.builder(inputPath) .withConf(conf) .build()) { Record record; while ((record = reader.read()) != null) { // ... } }


上一篇:
下一篇:
切换中文