use of cascading.tap.CompositeTap in project parquet-mr by apache.
the class ParquetTupleScheme method readSchema.
private MessageType readSchema(FlowProcess<? extends JobConf> flowProcess, Tap tap) {
try {
Hfs hfs;
if (tap instanceof CompositeTap)
hfs = (Hfs) ((CompositeTap) tap).getChildTaps().next();
else
hfs = (Hfs) tap;
List<Footer> footers = getFooters(flowProcess, hfs);
if (footers.isEmpty()) {
throw new TapException("Could not read Parquet metadata at " + hfs.getPath());
} else {
return footers.get(0).getParquetMetadata().getFileMetaData().getSchema();
}
} catch (IOException e) {
throw new TapException(e);
}
}
use of cascading.tap.CompositeTap in project parquet-mr by apache.
the class ParquetTupleScheme method readSchema.
private MessageType readSchema(FlowProcess<JobConf> flowProcess, Tap tap) {
try {
Hfs hfs;
if (tap instanceof CompositeTap)
hfs = (Hfs) ((CompositeTap) tap).getChildTaps().next();
else
hfs = (Hfs) tap;
List<Footer> footers = getFooters(flowProcess, hfs);
if (footers.isEmpty()) {
throw new TapException("Could not read Parquet metadata at " + hfs.getPath());
} else {
return footers.get(0).getParquetMetadata().getFileMetaData().getSchema();
}
} catch (IOException e) {
throw new TapException(e);
}
}
Aggregations