File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed
parquet-tools/src/main/java/org/apache/parquet/tools/command Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public void execute(CommandLine options) throws Exception {
7070 ParquetReader <SimpleRecord > reader = null ;
7171 try {
7272 PrintWriter writer = new PrintWriter (Main .out , true );
73- reader = new ParquetReader < SimpleRecord > (new Path ( input ), new SimpleReadSupport () );
73+ reader = ParquetReader . builder (new SimpleReadSupport ( ), new Path ( input )). build ( );
7474 for (SimpleRecord value = reader .read (); value != null ; value = reader .read ()) {
7575 if (options .hasOption ('j' )) {
7676 value .prettyPrintJson (writer );
Original file line number Diff line number Diff line change 4747import org .apache .parquet .column .page .DictionaryPage ;
4848import org .apache .parquet .column .page .PageReadStore ;
4949import org .apache .parquet .column .page .PageReader ;
50+ import org .apache .parquet .format .converter .ParquetMetadataConverter ;
5051import org .apache .parquet .hadoop .ParquetFileReader ;
5152import org .apache .parquet .hadoop .metadata .BlockMetaData ;
5253import org .apache .parquet .hadoop .metadata .ColumnChunkMetaData ;
6263
6364import com .google .common .base .Joiner ;
6465
66+ import static org .apache .parquet .format .converter .ParquetMetadataConverter .NO_FILTER ;
67+
6568public class DumpCommand extends ArgsOnlyCommand {
6669 private static final Charset UTF8 = Charset .forName ("UTF-8" );
6770 private static final CharsetDecoder UTF8_DECODER = UTF8 .newDecoder ();
@@ -115,7 +118,7 @@ public void execute(CommandLine options) throws Exception {
115118 Configuration conf = new Configuration ();
116119 Path inpath = new Path (input );
117120
118- ParquetMetadata metaData = ParquetFileReader .readFooter (conf , inpath );
121+ ParquetMetadata metaData = ParquetFileReader .readFooter (conf , inpath , NO_FILTER );
119122 MessageType schema = metaData .getFileMetaData ().getSchema ();
120123
121124 PrettyPrintWriter out = PrettyPrintWriter .stdoutPrettyPrinter ()
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public void execute(CommandLine options) throws Exception {
7878 ParquetReader <SimpleRecord > reader = null ;
7979 try {
8080 PrintWriter writer = new PrintWriter (Main .out , true );
81- reader = new ParquetReader < SimpleRecord > (new Path ( input ), new SimpleReadSupport () );
81+ reader = ParquetReader . builder (new SimpleReadSupport ( ), new Path ( input )). build ( );
8282 for (SimpleRecord value = reader .read (); value != null && num -- > 0 ; value = reader .read ()) {
8383 value .prettyPrint (writer );
8484 writer .println ();
Original file line number Diff line number Diff line change 3737import org .apache .parquet .tools .util .MetadataUtils ;
3838import org .apache .parquet .tools .util .PrettyPrintWriter ;
3939
40+ import static org .apache .parquet .format .converter .ParquetMetadataConverter .NO_FILTER ;
41+
4042public class ShowSchemaCommand extends ArgsOnlyCommand {
4143 public static final String [] USAGE = new String [] {
4244 "<input>" ,
@@ -88,7 +90,7 @@ public void execute(CommandLine options) throws Exception {
8890 } else {
8991 file = path ;
9092 }
91- metaData = ParquetFileReader .readFooter (conf , file );
93+ metaData = ParquetFileReader .readFooter (conf , file , NO_FILTER );
9294 MessageType schema = metaData .getFileMetaData ().getSchema ();
9395
9496 Main .out .println (schema );
You can’t perform that action at this time.
0 commit comments