本文整理匯總了Java中parquet.format.Util類的典型用法代碼示例。如果您正苦於以下問題:Java Util類的具體用法?Java Util怎麽用?Java Util使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Util類屬於parquet.format包,在下文中一共展示了Util類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readPageHeader
import parquet.format.Util; //導入依賴的package包/類
protected PageHeader readPageHeader() throws IOException {
PageHeader pageHeader;
int initialPos = this.pos;
try {
pageHeader = Util.readPageHeader(this);
} catch (IOException e) {
// this is to workaround a bug where the compressedLength
// of the chunk is missing the size of the header of the dictionary
// to allow reading older files (using dictionary) we need this.
// usually 13 to 19 bytes are missing
// if the last page is smaller than this, the page header itself is truncated in the buffer.
this.pos = initialPos; // resetting the buffer to the position before we got the error
LOG.info("completing the column chunk to read the page header");
pageHeader = Util.readPageHeader(new SequenceInputStream(this, f)); // trying again from the buffer + remainder of the stream.
}
return pageHeader;
}
示例2: readDictionaryPage
import parquet.format.Util; //導入依賴的package包/類
private static DictionaryPage readDictionaryPage(byte[] data, ParquetCodecFactory codecFactory, CompressionCodecName codecName)
{
try {
ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
PageHeader pageHeader = Util.readPageHeader(inputStream);
if (pageHeader.type != PageType.DICTIONARY_PAGE) {
return null;
}
// todo this wrapper is not needed
BytesInput compressedData = BytesInput.from(data, data.length - inputStream.available(), pageHeader.getCompressed_page_size());
BytesDecompressor decompressor = codecFactory.getDecompressor(codecName);
BytesInput decompressed = decompressor.decompress(compressedData, pageHeader.getUncompressed_page_size());
DictionaryPageHeader dicHeader = pageHeader.getDictionary_page_header();
Encoding encoding = Encoding.valueOf(dicHeader.getEncoding().name());
int dictionarySize = dicHeader.getNum_values();
return new DictionaryPage(decompressed, dictionarySize, encoding);
}
catch (IOException ignored) {
return null;
}
}
示例3: readPageHeader
import parquet.format.Util; //導入依賴的package包/類
public PageHeader readPageHeader() throws IOException{
return Util.readPageHeader(input);
}
示例4: readPageHeader
import parquet.format.Util; //導入依賴的package包/類
protected PageHeader readPageHeader()
throws IOException
{
return Util.readPageHeader(this);
}