Skip to content

Commit eb0b530

Browse files
committed
comments
1 parent 8daa6f5 commit eb0b530

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

parquet-cli/pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,26 +85,28 @@
8585
<artifactId>parquet-avro</artifactId>
8686
<version>${project.version}</version>
8787
</dependency>
88+
89+
<!-- Protobuf dependencies for CLI Tests -->
8890
<dependency>
8991
<groupId>org.apache.parquet</groupId>
9092
<artifactId>parquet-protobuf</artifactId>
9193
<version>${project.version}</version>
9294
<classifier>tests</classifier>
9395
<scope>test</scope>
9496
</dependency>
95-
<!-- CatCommandTest (for TestProtobuf) -->
9697
<dependency>
9798
<groupId>com.google.protobuf</groupId>
9899
<artifactId>protobuf-java</artifactId>
99100
<version>3.25.6</version>
100-
<scope>${deps.scope}</scope>
101+
<scope>test</scope>
101102
</dependency>
102103
<dependency>
103104
<groupId>org.apache.parquet</groupId>
104105
<artifactId>parquet-protobuf</artifactId>
105106
<version>${project.version}</version>
106-
<scope>${deps.scope}</scope>
107+
<scope>test</scope>
107108
</dependency>
109+
108110
<dependency>
109111
<groupId>org.apache.parquet</groupId>
110112
<artifactId>parquet-format-structures</artifactId>

parquet-cli/src/main/java/org/apache/parquet/cli/util/Schemas.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public static Schema fromParquet(Configuration conf, URI location) throws IOExce
8282
if (schemaString != null) {
8383
return new Schema.Parser().parse(schemaString);
8484
} else {
85-
return new AvroSchemaConverter().convert(footer.getFileMetaData().getSchema());
85+
return new AvroSchemaConverter(conf)
86+
.convert(footer.getFileMetaData().getSchema());
8687
}
8788
}
8889

parquet-cli/src/test/java/org/apache/parquet/cli/commands/CatCommandTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ public void testCatCommandProtoParquetAutoDetected() throws Exception {
8282
}
8383

8484
@Test
85-
public void testCatCommandProtoParquetSucceedsWithAutoDetection() throws Exception {
86-
File protoFile = new File(getTempFolder(), "proto_someevent.parquet");
87-
writeProtoParquet(protoFile);
85+
public void testCatCommandWithSimpleReaderConfig() throws Exception {
86+
File regularFile = parquetFile();
8887

89-
CatCommand cmd = new CatCommand(createLogger(), 0);
90-
cmd.sourceFiles = Arrays.asList(protoFile.getAbsolutePath());
91-
cmd.setConf(new Configuration());
88+
Configuration conf = new Configuration();
89+
conf.setBoolean("parquet.enable.simple-reader", true);
90+
91+
CatCommand cmd = new CatCommand(createLogger(), 5);
92+
cmd.sourceFiles = Arrays.asList(regularFile.getAbsolutePath());
93+
cmd.setConf(conf);
9294

9395
int result = cmd.run();
9496
Assert.assertEquals(0, result);

0 commit comments

Comments
 (0)