metadataIndex); inputStream.seek(metadataIndex); FileMetaData fileMetaData = readFileMetaData(inputStream); List<SchemaElement> schema = fileMetaData.getSchema(); validateParquet(!schema.isEmpty(), "Empty Parquet schema in file: %s", file);
@Override public FileMetaData visit(SkipMetadataFilter filter) throws IOException { return readFileMetaData(from, true); } @Override
@Override public FileMetaData visit(NoFilter filter) throws IOException { return readFileMetaData(from); } @Override
public static void readFileMetaData(InputStream from, FileMetaDataConsumer consumer) throws IOException { readFileMetaData(from, consumer, false); }
public static void readFileMetaData(InputStream from, FileMetaDataConsumer consumer) throws IOException { readFileMetaData(from, consumer, false); }
@Override public FileMetaData visit(RangeMetadataFilter filter) throws IOException { return filterFileMetaData(readFileMetaData(from), filter); } });
/** * reads the meta data from the stream * @param from the stream to read the metadata from * @param skipRowGroups whether row groups should be skipped * @return the resulting metadata * @throws IOException */ public static FileMetaData readFileMetaData(InputStream from, boolean skipRowGroups) throws IOException { FileMetaData md = new FileMetaData(); if (skipRowGroups) { readFileMetaData(from, new DefaultFileMetaDataConsumer(md), skipRowGroups); } else { read(from, md); } return md; }
/** * reads the meta data from the stream * @param from the stream to read the metadata from * @param skipRowGroups whether row groups should be skipped * @return the resulting metadata * @throws IOException */ public static FileMetaData readFileMetaData(InputStream from, boolean skipRowGroups) throws IOException { FileMetaData md = new FileMetaData(); if (skipRowGroups) { readFileMetaData(from, new DefaultFileMetaDataConsumer(md), skipRowGroups); } else { read(from, md); } return md; }
metadataIndex); inputStream.seek(metadataIndex); FileMetaData fileMetaData = readFileMetaData(inputStream); List<SchemaElement> schema = fileMetaData.getSchema(); validateParquet(!schema.isEmpty(), "Empty Parquet schema in file: %s", file);