@ Deprecated public static ParquetMetadata mergeMetadataFiles ( List < Path > files , Configuration conf ) throws IOException { Preconditions . checkArgument ( ! files . isEmpty ( ) , "Cannot merge an empty list of metadata" ) ; GlobalMetaData globalMetaData = null ; List < BlockMetaData > blocks = new ArrayList < BlockMetaData > ( ) ; for ( Path p : files ) { ParquetMetadata pmd = ParquetFileReader . readFooter ( conf , p , ParquetMetadataConverter . NO_FILTER ) ; FileMetaData fmd = pmd . getFileMetaData ( ) ; globalMetaData = mergeInto ( fmd , globalMetaData , true ) ; blocks . addAll ( pmd . getBlocks ( ) ) ; } // collapse GlobalMetaData into a single FileMetaData, which will throw if they are not compatible return new ParquetMetadata ( globalMetaData . merge ( ) , blocks ) ; }
Given a list of metadata files merge them into a single ParquetMetadata Requires that the schemas be compatible and the extraMetadata be exactly equal .