This is an automated email from the ASF dual-hosted git repository.
jiayuliu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 0900be278 Upgrade to thrift 0.17 and fix issues (#3104)
0900be278 is described below
commit 0900be27859974b8717185d65422c36d7e735b4e
Author: Jiayu Liu <[email protected]>
AuthorDate: Mon Nov 14 16:59:32 2022 +0800
Upgrade to thrift 0.17 and fix issues (#3104)
* test with thrift 0.17 and fix issues
* rebase
* remove databend prefix
* fix async reader
* fix doc err
* fix more doc items
---
arrow/src/row/dictionary.rs | 2 +-
parquet/Cargo.toml | 2 +-
parquet/src/arrow/async_reader.rs | 2 +-
parquet/src/bloom_filter/mod.rs | 2 +-
parquet/src/file/footer.rs | 2 +-
parquet/src/file/page_index/index_reader.rs | 2 +-
parquet/src/file/serialized_reader.rs | 2 +-
parquet/src/file/writer.rs | 2 +-
parquet/src/format.rs | 494 ++++++++++++++++++----------
9 files changed, 330 insertions(+), 180 deletions(-)
diff --git a/arrow/src/row/dictionary.rs b/arrow/src/row/dictionary.rs
index d8426ad0c..82169a37d 100644
--- a/arrow/src/row/dictionary.rs
+++ b/arrow/src/row/dictionary.rs
@@ -260,7 +260,7 @@ unsafe fn decode_fixed<T: FixedLengthEncoding +
ToByteSlice>(
.add_buffer(buffer.into());
// SAFETY: Buffers correct length
- unsafe { builder.build_unchecked() }
+ builder.build_unchecked()
}
/// Decodes a `PrimitiveArray` from dictionary values
diff --git a/parquet/Cargo.toml b/parquet/Cargo.toml
index dda0518f9..a5d43bf54 100644
--- a/parquet/Cargo.toml
+++ b/parquet/Cargo.toml
@@ -41,7 +41,7 @@ arrow-ipc = { version = "27.0.0", path = "../arrow-ipc",
default-features = fals
ahash = { version = "0.8", default-features = false, features =
["compile-time-rng"] }
bytes = { version = "1.1", default-features = false, features = ["std"] }
-thrift = { version = "0.16", default-features = false }
+thrift = { version = "0.17", default-features = false }
snap = { version = "1.0", default-features = false, optional = true }
brotli = { version = "3.3", default-features = false, features = ["std"],
optional = true }
flate2 = { version = "1.0", default-features = false, features =
["rust_backend"], optional = true }
diff --git a/parquet/src/arrow/async_reader.rs
b/parquet/src/arrow/async_reader.rs
index d52fa0406..e182cccbc 100644
--- a/parquet/src/arrow/async_reader.rs
+++ b/parquet/src/arrow/async_reader.rs
@@ -89,7 +89,7 @@ use bytes::{Buf, Bytes};
use futures::future::{BoxFuture, FutureExt};
use futures::ready;
use futures::stream::Stream;
-use thrift::protocol::TCompactInputProtocol;
+use thrift::protocol::{TCompactInputProtocol, TSerializable};
use tokio::io::{AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt};
diff --git a/parquet/src/bloom_filter/mod.rs b/parquet/src/bloom_filter/mod.rs
index 770fb53e8..adfd87307 100644
--- a/parquet/src/bloom_filter/mod.rs
+++ b/parquet/src/bloom_filter/mod.rs
@@ -25,7 +25,7 @@ use crate::format::{
};
use std::hash::Hasher;
use std::io::{Read, Seek, SeekFrom};
-use thrift::protocol::TCompactInputProtocol;
+use thrift::protocol::{TCompactInputProtocol, TSerializable};
use twox_hash::XxHash64;
/// Salt as defined in the
[spec](https://github.com/apache/parquet-format/blob/master/BloomFilter.md#technical-approach)
diff --git a/parquet/src/file/footer.rs b/parquet/src/file/footer.rs
index e8a114db7..27c07b78d 100644
--- a/parquet/src/file/footer.rs
+++ b/parquet/src/file/footer.rs
@@ -18,7 +18,7 @@
use std::{io::Read, sync::Arc};
use crate::format::{ColumnOrder as TColumnOrder, FileMetaData as
TFileMetaData};
-use thrift::protocol::TCompactInputProtocol;
+use thrift::protocol::{TCompactInputProtocol, TSerializable};
use crate::basic::ColumnOrder;
diff --git a/parquet/src/file/page_index/index_reader.rs
b/parquet/src/file/page_index/index_reader.rs
index 99877a921..af23c0bd9 100644
--- a/parquet/src/file/page_index/index_reader.rs
+++ b/parquet/src/file/page_index/index_reader.rs
@@ -23,7 +23,7 @@ use crate::file::page_index::index::{BooleanIndex,
ByteArrayIndex, Index, Native
use crate::file::reader::ChunkReader;
use crate::format::{ColumnIndex, OffsetIndex, PageLocation};
use std::io::{Cursor, Read};
-use thrift::protocol::TCompactInputProtocol;
+use thrift::protocol::{TCompactInputProtocol, TSerializable};
/// Read on row group's all columns indexes and change into [`Index`]
/// If not the format not available return an empty vector.
diff --git a/parquet/src/file/serialized_reader.rs
b/parquet/src/file/serialized_reader.rs
index a400d4dab..ebe87aca6 100644
--- a/parquet/src/file/serialized_reader.rs
+++ b/parquet/src/file/serialized_reader.rs
@@ -24,7 +24,7 @@ use std::{convert::TryFrom, fs::File, io::Read, path::Path,
sync::Arc};
use crate::format::{PageHeader, PageLocation, PageType};
use bytes::{Buf, Bytes};
-use thrift::protocol::TCompactInputProtocol;
+use thrift::protocol::{TCompactInputProtocol, TSerializable};
use crate::basic::{Encoding, Type};
use crate::column::page::{Page, PageMetadata, PageReader};
diff --git a/parquet/src/file/writer.rs b/parquet/src/file/writer.rs
index 528f72494..2efaf7caf 100644
--- a/parquet/src/file/writer.rs
+++ b/parquet/src/file/writer.rs
@@ -22,7 +22,7 @@ use std::{io::Write, sync::Arc};
use crate::format as parquet;
use crate::format::{ColumnIndex, OffsetIndex, RowGroup};
-use thrift::protocol::{TCompactOutputProtocol, TOutputProtocol};
+use thrift::protocol::{TCompactOutputProtocol, TOutputProtocol, TSerializable};
use crate::basic::PageType;
use crate::column::writer::{
diff --git a/parquet/src/format.rs b/parquet/src/format.rs
index 6fb2e32eb..0851b2287 100644
--- a/parquet/src/format.rs
+++ b/parquet/src/format.rs
@@ -1,4 +1,4 @@
-// Autogenerated by Thrift Compiler (0.16.0)
+// Autogenerated by Thrift Compiler (0.17.0)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#![allow(unused_imports)]
@@ -17,7 +17,7 @@ use std::rc::Rc;
use thrift::OrderedFloat;
use thrift::{ApplicationError, ApplicationErrorKind, ProtocolError,
ProtocolErrorKind, TThriftClient};
-use thrift::protocol::{TFieldIdentifier, TListIdentifier, TMapIdentifier,
TMessageIdentifier, TMessageType, TInputProtocol, TOutputProtocol,
TSetIdentifier, TStructIdentifier, TType};
+use thrift::protocol::{TFieldIdentifier, TListIdentifier, TMapIdentifier,
TMessageIdentifier, TMessageType, TInputProtocol, TOutputProtocol,
TSerializable, TSetIdentifier, TStructIdentifier, TType};
use thrift::protocol::field_id;
use thrift::protocol::verify_expected_message_type;
use thrift::protocol::verify_expected_sequence_number;
@@ -50,11 +50,14 @@ impl Type {
Self::BYTE_ARRAY,
Self::FIXED_LEN_BYTE_ARRAY,
];
+}
+
+impl TSerializable for Type {
#[allow(clippy::trivially_copy_pass_by_ref)]
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
o_prot.write_i32(self.0)
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Type> {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Type> {
let enum_value = i_prot.read_i32()?;
Ok(Type::from(enum_value))
}
@@ -96,7 +99,7 @@ impl From<&Type> for i32 {
/// DEPRECATED: Common types used by frameworks(e.g. hive, pig) using parquet.
/// ConvertedType is superseded by LogicalType. This enum should not be
extended.
-///
+///
/// See LogicalTypes.md for conversion between ConvertedType and LogicalType.
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ConvertedType(pub i32);
@@ -114,12 +117,12 @@ impl ConvertedType {
/// an enum is converted into a binary field
pub const ENUM: ConvertedType = ConvertedType(4);
/// A decimal value.
- ///
+ ///
/// This may be used to annotate binary or fixed primitive types. The
/// underlying byte array stores the unscaled value encoded as two's
/// complement using big-endian byte order (the most significant byte is the
/// zeroth element). The value of the decimal is the value * 10^{-scale}.
- ///
+ ///
/// This must be accompanied by a (maximum) precision and a scale in the
/// SchemaElement. The precision specifies the number of digits in the
decimal
/// and the scale stores the location of the decimal point. For example 1.23
@@ -127,62 +130,62 @@ impl ConvertedType {
/// 2 digits over).
pub const DECIMAL: ConvertedType = ConvertedType(5);
/// A Date
- ///
+ ///
/// Stored as days since Unix epoch, encoded as the INT32 physical type.
- ///
+ ///
pub const DATE: ConvertedType = ConvertedType(6);
/// A time
- ///
+ ///
/// The total number of milliseconds since midnight. The value is stored
/// as an INT32 physical type.
pub const TIME_MILLIS: ConvertedType = ConvertedType(7);
/// A time.
- ///
+ ///
/// The total number of microseconds since midnight. The value is stored as
/// an INT64 physical type.
pub const TIME_MICROS: ConvertedType = ConvertedType(8);
/// A date/time combination
- ///
+ ///
/// Date and time recorded as milliseconds since the Unix epoch. Recorded as
/// a physical type of INT64.
pub const TIMESTAMP_MILLIS: ConvertedType = ConvertedType(9);
/// A date/time combination
- ///
+ ///
/// Date and time recorded as microseconds since the Unix epoch. The value
is
/// stored as an INT64 physical type.
pub const TIMESTAMP_MICROS: ConvertedType = ConvertedType(10);
/// An unsigned integer value.
- ///
+ ///
/// The number describes the maximum number of meaningful data bits in
/// the stored value. 8, 16 and 32 bit values are stored using the
/// INT32 physical type. 64 bit values are stored using the INT64
/// physical type.
- ///
+ ///
pub const UINT_8: ConvertedType = ConvertedType(11);
pub const UINT_16: ConvertedType = ConvertedType(12);
pub const UINT_32: ConvertedType = ConvertedType(13);
pub const UINT_64: ConvertedType = ConvertedType(14);
/// A signed integer value.
- ///
+ ///
/// The number describes the maximum number of meaningful data bits in
/// the stored value. 8, 16 and 32 bit values are stored using the
/// INT32 physical type. 64 bit values are stored using the INT64
/// physical type.
- ///
+ ///
pub const INT_8: ConvertedType = ConvertedType(15);
pub const INT_16: ConvertedType = ConvertedType(16);
pub const INT_32: ConvertedType = ConvertedType(17);
pub const INT_64: ConvertedType = ConvertedType(18);
/// An embedded JSON document
- ///
+ ///
/// A JSON document embedded within a single UTF8 column.
pub const JSON: ConvertedType = ConvertedType(19);
/// An embedded BSON document
- ///
+ ///
/// A BSON document embedded within a single BINARY column.
pub const BSON: ConvertedType = ConvertedType(20);
/// An interval of time
- ///
+ ///
/// This type annotates data stored as a FIXED_LEN_BYTE_ARRAY of length 12
/// This data is composed of three separate little endian unsigned
/// integers. Each stores a component of a duration of time. The first
@@ -216,11 +219,14 @@ impl ConvertedType {
Self::BSON,
Self::INTERVAL,
];
+}
+
+impl TSerializable for ConvertedType {
#[allow(clippy::trivially_copy_pass_by_ref)]
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
o_prot.write_i32(self.0)
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ConvertedType> {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ConvertedType> {
let enum_value = i_prot.read_i32()?;
Ok(ConvertedType::from(enum_value))
}
@@ -290,11 +296,14 @@ impl FieldRepetitionType {
Self::OPTIONAL,
Self::REPEATED,
];
+}
+
+impl TSerializable for FieldRepetitionType {
#[allow(clippy::trivially_copy_pass_by_ref)]
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
o_prot.write_i32(self.0)
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<FieldRepetitionType> {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<FieldRepetitionType> {
let enum_value = i_prot.read_i32()?;
Ok(FieldRepetitionType::from(enum_value))
}
@@ -385,11 +394,14 @@ impl Encoding {
Self::RLE_DICTIONARY,
Self::BYTE_STREAM_SPLIT,
];
+}
+
+impl TSerializable for Encoding {
#[allow(clippy::trivially_copy_pass_by_ref)]
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
o_prot.write_i32(self.0)
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Encoding> {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Encoding> {
let enum_value = i_prot.read_i32()?;
Ok(Encoding::from(enum_value))
}
@@ -431,11 +443,11 @@ impl From<&Encoding> for i32 {
}
/// Supported compression algorithms.
-///
+///
/// Codecs added in format version X.Y can be read by readers based on X.Y and
later.
/// Codec support may vary between readers based on the format version and
/// libraries available at runtime.
-///
+///
/// See Compression.md for a detailed specification of these algorithms.
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CompressionCodec(pub i32);
@@ -459,11 +471,14 @@ impl CompressionCodec {
Self::ZSTD,
Self::LZ4_RAW,
];
+}
+
+impl TSerializable for CompressionCodec {
#[allow(clippy::trivially_copy_pass_by_ref)]
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
o_prot.write_i32(self.0)
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<CompressionCodec> {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<CompressionCodec> {
let enum_value = i_prot.read_i32()?;
Ok(CompressionCodec::from(enum_value))
}
@@ -517,11 +532,14 @@ impl PageType {
Self::DICTIONARY_PAGE,
Self::DATA_PAGE_V2,
];
+}
+
+impl TSerializable for PageType {
#[allow(clippy::trivially_copy_pass_by_ref)]
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
o_prot.write_i32(self.0)
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageType> {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageType> {
let enum_value = i_prot.read_i32()?;
Ok(PageType::from(enum_value))
}
@@ -571,11 +589,14 @@ impl BoundaryOrder {
Self::ASCENDING,
Self::DESCENDING,
];
+}
+
+impl TSerializable for BoundaryOrder {
#[allow(clippy::trivially_copy_pass_by_ref)]
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
o_prot.write_i32(self.0)
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BoundaryOrder> {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BoundaryOrder> {
let enum_value = i_prot.read_i32()?;
Ok(BoundaryOrder::from(enum_value))
}
@@ -619,14 +640,14 @@ impl From<&BoundaryOrder> for i32 {
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Statistics {
/// DEPRECATED: min and max value of the column. Use min_value and max_value.
- ///
+ ///
/// Values are encoded using PLAIN encoding, except that variable-length byte
/// arrays do not include a length prefix.
- ///
+ ///
/// These fields encode min and max values determined by signed comparison
/// only. New files should use the correct order for a column's logical type
/// and store the values in the min_value and max_value fields.
- ///
+ ///
/// To support older readers, these may be set when the column order is
/// signed.
pub max: Option<Vec<u8>>,
@@ -636,7 +657,7 @@ pub struct Statistics {
/// count of distinct values occurring
pub distinct_count: Option<i64>,
/// Min and max values for the column, determined by its ColumnOrder.
- ///
+ ///
/// Values are encoded using PLAIN encoding, except that variable-length byte
/// arrays do not include a length prefix.
pub max_value: Option<Vec<u8>>,
@@ -654,7 +675,10 @@ impl Statistics {
min_value: min_value.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Statistics> {
+}
+
+impl TSerializable for Statistics {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Statistics> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Vec<u8>> = None;
let mut f_2: Option<Vec<u8>> = None;
@@ -710,7 +734,7 @@ impl Statistics {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("Statistics");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.max {
@@ -774,7 +798,10 @@ impl StringType {
pub fn new() -> StringType {
StringType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<StringType> {
+}
+
+impl TSerializable for StringType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<StringType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -793,7 +820,7 @@ impl StringType {
let ret = StringType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("StringType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -819,7 +846,10 @@ impl UUIDType {
pub fn new() -> UUIDType {
UUIDType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<UUIDType> {
+}
+
+impl TSerializable for UUIDType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<UUIDType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -838,7 +868,7 @@ impl UUIDType {
let ret = UUIDType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("UUIDType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -864,7 +894,10 @@ impl MapType {
pub fn new() -> MapType {
MapType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<MapType> {
+}
+
+impl TSerializable for MapType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<MapType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -883,7 +916,7 @@ impl MapType {
let ret = MapType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("MapType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -909,7 +942,10 @@ impl ListType {
pub fn new() -> ListType {
ListType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ListType> {
+}
+
+impl TSerializable for ListType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ListType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -928,7 +964,7 @@ impl ListType {
let ret = ListType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ListType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -954,7 +990,10 @@ impl EnumType {
pub fn new() -> EnumType {
EnumType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EnumType> {
+}
+
+impl TSerializable for EnumType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EnumType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -973,7 +1012,7 @@ impl EnumType {
let ret = EnumType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("EnumType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -999,7 +1038,10 @@ impl DateType {
pub fn new() -> DateType {
DateType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DateType> {
+}
+
+impl TSerializable for DateType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DateType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -1018,7 +1060,7 @@ impl DateType {
let ret = DateType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DateType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -1037,7 +1079,7 @@ impl Default for DateType {
//
/// Logical type to annotate a column that is always null.
-///
+///
/// Sometimes when discovering the schema of existing data, values are always
/// null and the physical type can't be determined. This annotation signals
/// the case where the physical type was guessed from all null values.
@@ -1049,7 +1091,10 @@ impl NullType {
pub fn new() -> NullType {
NullType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<NullType> {
+}
+
+impl TSerializable for NullType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<NullType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -1068,7 +1113,7 @@ impl NullType {
let ret = NullType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("NullType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -1087,10 +1132,10 @@ impl Default for NullType {
//
/// Decimal logical type annotation
-///
+///
/// To maintain forward-compatibility in v1, implementations using this logical
/// type must also set scale and precision on the annotated SchemaElement.
-///
+///
/// Allowed for physical types: INT32, INT64, FIXED, and BINARY
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DecimalType {
@@ -1105,7 +1150,10 @@ impl DecimalType {
precision,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DecimalType> {
+}
+
+impl TSerializable for DecimalType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DecimalType> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
let mut f_2: Option<i32> = None;
@@ -1139,7 +1187,7 @@ impl DecimalType {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DecimalType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("scale", TType::I32, 1))?;
@@ -1166,7 +1214,10 @@ impl MilliSeconds {
pub fn new() -> MilliSeconds {
MilliSeconds {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<MilliSeconds> {
+}
+
+impl TSerializable for MilliSeconds {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<MilliSeconds> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -1185,7 +1236,7 @@ impl MilliSeconds {
let ret = MilliSeconds {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("MilliSeconds");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -1211,7 +1262,10 @@ impl MicroSeconds {
pub fn new() -> MicroSeconds {
MicroSeconds {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<MicroSeconds> {
+}
+
+impl TSerializable for MicroSeconds {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<MicroSeconds> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -1230,7 +1284,7 @@ impl MicroSeconds {
let ret = MicroSeconds {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("MicroSeconds");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -1256,7 +1310,10 @@ impl NanoSeconds {
pub fn new() -> NanoSeconds {
NanoSeconds {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<NanoSeconds> {
+}
+
+impl TSerializable for NanoSeconds {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<NanoSeconds> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -1275,7 +1332,7 @@ impl NanoSeconds {
let ret = NanoSeconds {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("NanoSeconds");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -1300,8 +1357,8 @@ pub enum TimeUnit {
NANOS(NanoSeconds),
}
-impl TimeUnit {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TimeUnit> {
+impl TSerializable for TimeUnit {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TimeUnit> {
let mut ret: Option<TimeUnit> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -1363,7 +1420,7 @@ impl TimeUnit {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("TimeUnit");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -1393,7 +1450,7 @@ impl TimeUnit {
//
/// Timestamp logical type annotation
-///
+///
/// Allowed for physical types: INT64
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TimestampType {
@@ -1408,7 +1465,10 @@ impl TimestampType {
unit,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TimestampType> {
+}
+
+impl TSerializable for TimestampType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TimestampType> {
i_prot.read_struct_begin()?;
let mut f_1: Option<bool> = None;
let mut f_2: Option<TimeUnit> = None;
@@ -1442,7 +1502,7 @@ impl TimestampType {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("TimestampType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("isAdjustedToUTC",
TType::Bool, 1))?;
@@ -1461,7 +1521,7 @@ impl TimestampType {
//
/// Time logical type annotation
-///
+///
/// Allowed for physical types: INT32 (millis), INT64 (micros, nanos)
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TimeType {
@@ -1476,7 +1536,10 @@ impl TimeType {
unit,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TimeType> {
+}
+
+impl TSerializable for TimeType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TimeType> {
i_prot.read_struct_begin()?;
let mut f_1: Option<bool> = None;
let mut f_2: Option<TimeUnit> = None;
@@ -1510,7 +1573,7 @@ impl TimeType {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("TimeType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("isAdjustedToUTC",
TType::Bool, 1))?;
@@ -1529,9 +1592,9 @@ impl TimeType {
//
/// Integer logical type annotation
-///
+///
/// bitWidth must be 8, 16, 32, or 64.
-///
+///
/// Allowed for physical types: INT32, INT64
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct IntType {
@@ -1546,7 +1609,10 @@ impl IntType {
is_signed,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<IntType> {
+}
+
+impl TSerializable for IntType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<IntType> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i8> = None;
let mut f_2: Option<bool> = None;
@@ -1580,7 +1646,7 @@ impl IntType {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("IntType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("bitWidth", TType::I08,
1))?;
@@ -1599,7 +1665,7 @@ impl IntType {
//
/// Embedded JSON logical type annotation
-///
+///
/// Allowed for physical types: BINARY
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct JsonType {
@@ -1609,7 +1675,10 @@ impl JsonType {
pub fn new() -> JsonType {
JsonType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<JsonType> {
+}
+
+impl TSerializable for JsonType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<JsonType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -1628,7 +1697,7 @@ impl JsonType {
let ret = JsonType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("JsonType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -1647,7 +1716,7 @@ impl Default for JsonType {
//
/// Embedded BSON logical type annotation
-///
+///
/// Allowed for physical types: BINARY
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BsonType {
@@ -1657,7 +1726,10 @@ impl BsonType {
pub fn new() -> BsonType {
BsonType {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BsonType> {
+}
+
+impl TSerializable for BsonType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BsonType> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -1676,7 +1748,7 @@ impl BsonType {
let ret = BsonType {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("BsonType");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -1711,8 +1783,8 @@ pub enum LogicalType {
UUID(UUIDType),
}
-impl LogicalType {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<LogicalType> {
+impl TSerializable for LogicalType {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<LogicalType> {
let mut ret: Option<LogicalType> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -1844,7 +1916,7 @@ impl LogicalType {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("LogicalType");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -1948,12 +2020,12 @@ pub struct SchemaElement {
pub num_children: Option<i32>,
/// DEPRECATED: When the schema is the result of a conversion from another
model.
/// Used to record the original type to help with cross conversion.
- ///
+ ///
/// This is superseded by logicalType.
pub converted_type: Option<ConvertedType>,
/// DEPRECATED: Used when this column contains decimal data.
/// See the DECIMAL converted type for more details.
- ///
+ ///
/// This is superseded by using the DecimalType annotation in logicalType.
pub scale: Option<i32>,
pub precision: Option<i32>,
@@ -1961,7 +2033,7 @@ pub struct SchemaElement {
/// original field id in the parquet schema
pub field_id: Option<i32>,
/// The logical type of this SchemaElement
- ///
+ ///
/// LogicalType replaces ConvertedType, but ConvertedType is still required
/// for some logical types to ensure forward-compatibility in format v1.
pub logical_type: Option<LogicalType>,
@@ -1982,7 +2054,10 @@ impl SchemaElement {
logical_type: logical_type.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<SchemaElement> {
+}
+
+impl TSerializable for SchemaElement {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<SchemaElement> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Type> = None;
let mut f_2: Option<i32> = None;
@@ -2063,7 +2138,7 @@ impl SchemaElement {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SchemaElement");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.type_ {
@@ -2148,7 +2223,10 @@ impl DataPageHeader {
statistics: statistics.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DataPageHeader> {
+}
+
+impl TSerializable for DataPageHeader {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DataPageHeader> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
let mut f_2: Option<Encoding> = None;
@@ -2202,7 +2280,7 @@ impl DataPageHeader {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DataPageHeader");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("num_values", TType::I32,
1))?;
@@ -2239,7 +2317,10 @@ impl IndexPageHeader {
pub fn new() -> IndexPageHeader {
IndexPageHeader {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<IndexPageHeader> {
+}
+
+impl TSerializable for IndexPageHeader {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<IndexPageHeader> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -2258,7 +2339,7 @@ impl IndexPageHeader {
let ret = IndexPageHeader {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("IndexPageHeader");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -2294,7 +2375,10 @@ impl DictionaryPageHeader {
is_sorted: is_sorted.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DictionaryPageHeader> {
+}
+
+impl TSerializable for DictionaryPageHeader {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DictionaryPageHeader> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
let mut f_2: Option<Encoding> = None;
@@ -2334,7 +2418,7 @@ impl DictionaryPageHeader {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DictionaryPageHeader");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("num_values", TType::I32,
1))?;
@@ -2360,7 +2444,7 @@ impl DictionaryPageHeader {
/// New page format allowing reading levels without decompressing the data
/// Repetition and definition levels are uncompressed
/// The remaining section containing the data is compressed if is_compressed
is true
-///
+///
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DataPageHeaderV2 {
/// Number of values, including NULLs, in this data page. *
@@ -2399,7 +2483,10 @@ impl DataPageHeaderV2 {
statistics: statistics.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DataPageHeaderV2> {
+}
+
+impl TSerializable for DataPageHeaderV2 {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<DataPageHeaderV2> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
let mut f_2: Option<i32> = None;
@@ -2473,7 +2560,7 @@ impl DataPageHeaderV2 {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("DataPageHeaderV2");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("num_values", TType::I32,
1))?;
@@ -2522,7 +2609,10 @@ impl SplitBlockAlgorithm {
pub fn new() -> SplitBlockAlgorithm {
SplitBlockAlgorithm {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<SplitBlockAlgorithm> {
+}
+
+impl TSerializable for SplitBlockAlgorithm {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<SplitBlockAlgorithm> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -2541,7 +2631,7 @@ impl SplitBlockAlgorithm {
let ret = SplitBlockAlgorithm {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SplitBlockAlgorithm");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -2564,8 +2654,8 @@ pub enum BloomFilterAlgorithm {
BLOCK(SplitBlockAlgorithm),
}
-impl BloomFilterAlgorithm {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterAlgorithm> {
+impl TSerializable for BloomFilterAlgorithm {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterAlgorithm> {
let mut ret: Option<BloomFilterAlgorithm> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -2613,7 +2703,7 @@ impl BloomFilterAlgorithm {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("BloomFilterAlgorithm");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -2634,7 +2724,7 @@ impl BloomFilterAlgorithm {
/// Hash strategy type annotation. xxHash is an extremely fast
non-cryptographic hash
/// algorithm. It uses 64 bits version of xxHash.
-///
+///
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct XxHash {
}
@@ -2643,7 +2733,10 @@ impl XxHash {
pub fn new() -> XxHash {
XxHash {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<XxHash> {
+}
+
+impl TSerializable for XxHash {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<XxHash> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -2662,7 +2755,7 @@ impl XxHash {
let ret = XxHash {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("XxHash");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -2685,8 +2778,8 @@ pub enum BloomFilterHash {
XXHASH(XxHash),
}
-impl BloomFilterHash {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterHash> {
+impl TSerializable for BloomFilterHash {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterHash> {
let mut ret: Option<BloomFilterHash> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -2734,7 +2827,7 @@ impl BloomFilterHash {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("BloomFilterHash");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -2754,7 +2847,7 @@ impl BloomFilterHash {
//
/// The compression used in the Bloom filter.
-///
+///
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Uncompressed {
}
@@ -2763,7 +2856,10 @@ impl Uncompressed {
pub fn new() -> Uncompressed {
Uncompressed {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Uncompressed> {
+}
+
+impl TSerializable for Uncompressed {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<Uncompressed> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -2782,7 +2878,7 @@ impl Uncompressed {
let ret = Uncompressed {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("Uncompressed");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -2805,8 +2901,8 @@ pub enum BloomFilterCompression {
UNCOMPRESSED(Uncompressed),
}
-impl BloomFilterCompression {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterCompression> {
+impl TSerializable for BloomFilterCompression {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterCompression> {
let mut ret: Option<BloomFilterCompression> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -2854,7 +2950,7 @@ impl BloomFilterCompression {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("BloomFilterCompression");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -2875,7 +2971,7 @@ impl BloomFilterCompression {
/// Bloom filter header is stored at beginning of Bloom filter data of each
column
/// and followed by its bitset.
-///
+///
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BloomFilterHeader {
/// The size of bitset in bytes *
@@ -2897,7 +2993,10 @@ impl BloomFilterHeader {
compression,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterHeader> {
+}
+
+impl TSerializable for BloomFilterHeader {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<BloomFilterHeader> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
let mut f_2: Option<BloomFilterAlgorithm> = None;
@@ -2945,7 +3044,7 @@ impl BloomFilterHeader {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("BloomFilterHeader");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("numBytes", TType::I32,
1))?;
@@ -3002,7 +3101,7 @@ pub struct PageHeader {
/// encryption itself is performed after page compression (if compressed)
/// If enabled, this allows for disabling checksumming in HDFS if only a few
/// pages need to be read.
- ///
+ ///
pub crc: Option<i32>,
pub data_page_header: Option<DataPageHeader>,
pub index_page_header: Option<IndexPageHeader>,
@@ -3023,7 +3122,10 @@ impl PageHeader {
data_page_header_v2: data_page_header_v2.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageHeader> {
+}
+
+impl TSerializable for PageHeader {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageHeader> {
i_prot.read_struct_begin()?;
let mut f_1: Option<PageType> = None;
let mut f_2: Option<i32> = None;
@@ -3094,7 +3196,7 @@ impl PageHeader {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("PageHeader");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("type", TType::I32, 1))?;
@@ -3154,7 +3256,10 @@ impl KeyValue {
value: value.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<KeyValue> {
+}
+
+impl TSerializable for KeyValue {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<KeyValue> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<String> = None;
@@ -3187,7 +3292,7 @@ impl KeyValue {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("KeyValue");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("key", TType::String, 1))?;
@@ -3227,7 +3332,10 @@ impl SortingColumn {
nulls_first,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<SortingColumn> {
+}
+
+impl TSerializable for SortingColumn {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<SortingColumn> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
let mut f_2: Option<bool> = None;
@@ -3268,7 +3376,7 @@ impl SortingColumn {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("SortingColumn");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("column_idx", TType::I32,
1))?;
@@ -3308,7 +3416,10 @@ impl PageEncodingStats {
count,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageEncodingStats> {
+}
+
+impl TSerializable for PageEncodingStats {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageEncodingStats> {
i_prot.read_struct_begin()?;
let mut f_1: Option<PageType> = None;
let mut f_2: Option<Encoding> = None;
@@ -3349,7 +3460,7 @@ impl PageEncodingStats {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("PageEncodingStats");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("page_type", TType::I32,
1))?;
@@ -3426,7 +3537,10 @@ impl ColumnMetaData {
bloom_filter_offset: bloom_filter_offset.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnMetaData> {
+}
+
+impl TSerializable for ColumnMetaData {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnMetaData> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Type> = None;
let mut f_2: Option<Vec<Encoding>> = None;
@@ -3562,7 +3676,7 @@ impl ColumnMetaData {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ColumnMetaData");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("type", TType::I32, 1))?;
@@ -3652,7 +3766,10 @@ impl EncryptionWithFooterKey {
pub fn new() -> EncryptionWithFooterKey {
EncryptionWithFooterKey {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EncryptionWithFooterKey> {
+}
+
+impl TSerializable for EncryptionWithFooterKey {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EncryptionWithFooterKey> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -3671,7 +3788,7 @@ impl EncryptionWithFooterKey {
let ret = EncryptionWithFooterKey {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("EncryptionWithFooterKey");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -3704,7 +3821,10 @@ impl EncryptionWithColumnKey {
key_metadata: key_metadata.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EncryptionWithColumnKey> {
+}
+
+impl TSerializable for EncryptionWithColumnKey {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EncryptionWithColumnKey> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Vec<String>> = None;
let mut f_2: Option<Vec<u8>> = None;
@@ -3743,7 +3863,7 @@ impl EncryptionWithColumnKey {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("EncryptionWithColumnKey");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("path_in_schema",
TType::List, 1))?;
@@ -3773,8 +3893,8 @@ pub enum ColumnCryptoMetaData {
ENCRYPTIONWITHCOLUMNKEY(EncryptionWithColumnKey),
}
-impl ColumnCryptoMetaData {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnCryptoMetaData> {
+impl TSerializable for ColumnCryptoMetaData {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnCryptoMetaData> {
let mut ret: Option<ColumnCryptoMetaData> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -3829,7 +3949,7 @@ impl ColumnCryptoMetaData {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ColumnCryptoMetaData");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -3857,14 +3977,14 @@ impl ColumnCryptoMetaData {
pub struct ColumnChunk {
/// File where column data is stored. If not set, assumed to be same file as
/// metadata. This path is relative to the current file.
- ///
+ ///
pub file_path: Option<String>,
/// Byte offset in file_path to the ColumnMetaData *
pub file_offset: i64,
/// Column metadata for this chunk. This is the same content as what is at
/// file_path/file_offset. Having it here has it replicated in the file
/// metadata.
- ///
+ ///
pub meta_data: Option<ColumnMetaData>,
/// File offset of ColumnChunk's OffsetIndex *
pub offset_index_offset: Option<i64>,
@@ -3894,7 +4014,10 @@ impl ColumnChunk {
encrypted_column_metadata: encrypted_column_metadata.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnChunk> {
+}
+
+impl TSerializable for ColumnChunk {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnChunk> {
i_prot.read_struct_begin()?;
let mut f_1: Option<String> = None;
let mut f_2: Option<i64> = None;
@@ -3969,7 +4092,7 @@ impl ColumnChunk {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ColumnChunk");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.file_path {
@@ -4028,7 +4151,7 @@ impl ColumnChunk {
pub struct RowGroup {
/// Metadata for each column chunk in this row group.
/// This list must have the same order as the SchemaElement list in
FileMetaData.
- ///
+ ///
pub columns: Vec<ColumnChunk>,
/// Total byte size of all the uncompressed column data in this row group *
pub total_byte_size: i64,
@@ -4059,7 +4182,10 @@ impl RowGroup {
ordinal: ordinal.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<RowGroup> {
+}
+
+impl TSerializable for RowGroup {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<RowGroup> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Vec<ColumnChunk>> = None;
let mut f_2: Option<i64> = None;
@@ -4136,7 +4262,7 @@ impl RowGroup {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("RowGroup");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("columns", TType::List,
1))?;
@@ -4194,7 +4320,10 @@ impl TypeDefinedOrder {
pub fn new() -> TypeDefinedOrder {
TypeDefinedOrder {}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TypeDefinedOrder> {
+}
+
+impl TSerializable for TypeDefinedOrder {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<TypeDefinedOrder> {
i_prot.read_struct_begin()?;
loop {
let field_ident = i_prot.read_field_begin()?;
@@ -4213,7 +4342,7 @@ impl TypeDefinedOrder {
let ret = TypeDefinedOrder {};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("TypeDefinedOrder");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_stop()?;
@@ -4236,8 +4365,8 @@ pub enum ColumnOrder {
TYPEORDER(TypeDefinedOrder),
}
-impl ColumnOrder {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnOrder> {
+impl TSerializable for ColumnOrder {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnOrder> {
let mut ret: Option<ColumnOrder> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -4285,7 +4414,7 @@ impl ColumnOrder {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ColumnOrder");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -4324,7 +4453,10 @@ impl PageLocation {
first_row_index,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageLocation> {
+}
+
+impl TSerializable for PageLocation {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<PageLocation> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i64> = None;
let mut f_2: Option<i32> = None;
@@ -4365,7 +4497,7 @@ impl PageLocation {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("PageLocation");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("offset", TType::I64, 1))?;
@@ -4399,7 +4531,10 @@ impl OffsetIndex {
page_locations,
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<OffsetIndex> {
+}
+
+impl TSerializable for OffsetIndex {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<OffsetIndex> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Vec<PageLocation>> = None;
loop {
@@ -4432,7 +4567,7 @@ impl OffsetIndex {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("OffsetIndex");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("page_locations",
TType::List, 1))?;
@@ -4470,7 +4605,7 @@ pub struct ColumnIndex {
/// that list entries are populated before using them by inspecting
null_pages.
pub min_values: Vec<Vec<u8>>,
pub max_values: Vec<Vec<u8>>,
- /// Stores whether both min_values and max_values are orderd and if so, in
+ /// Stores whether both min_values and max_values are ordered and if so, in
/// which direction. This allows readers to perform binary searches in both
/// lists. Readers cannot assume that max_values\[i\] <= min_values\[i+1\],
even
/// if the lists are ordered.
@@ -4489,7 +4624,10 @@ impl ColumnIndex {
null_counts: null_counts.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnIndex> {
+}
+
+impl TSerializable for ColumnIndex {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<ColumnIndex> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Vec<bool>> = None;
let mut f_2: Option<Vec<Vec<u8>>> = None;
@@ -4567,7 +4705,7 @@ impl ColumnIndex {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("ColumnIndex");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("null_pages", TType::List,
1))?;
@@ -4631,7 +4769,10 @@ impl AesGcmV1 {
supply_aad_prefix: supply_aad_prefix.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<AesGcmV1> {
+}
+
+impl TSerializable for AesGcmV1 {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<AesGcmV1> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Vec<u8>> = None;
let mut f_2: Option<Vec<u8>> = None;
@@ -4669,7 +4810,7 @@ impl AesGcmV1 {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("AesGcmV1");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.aad_prefix {
@@ -4725,7 +4866,10 @@ impl AesGcmCtrV1 {
supply_aad_prefix: supply_aad_prefix.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<AesGcmCtrV1> {
+}
+
+impl TSerializable for AesGcmCtrV1 {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<AesGcmCtrV1> {
i_prot.read_struct_begin()?;
let mut f_1: Option<Vec<u8>> = None;
let mut f_2: Option<Vec<u8>> = None;
@@ -4763,7 +4907,7 @@ impl AesGcmCtrV1 {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("AesGcmCtrV1");
o_prot.write_struct_begin(&struct_ident)?;
if let Some(ref fld_var) = self.aad_prefix {
@@ -4806,8 +4950,8 @@ pub enum EncryptionAlgorithm {
AESGCMCTRV1(AesGcmCtrV1),
}
-impl EncryptionAlgorithm {
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EncryptionAlgorithm> {
+impl TSerializable for EncryptionAlgorithm {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<EncryptionAlgorithm> {
let mut ret: Option<EncryptionAlgorithm> = None;
let mut received_field_count = 0;
i_prot.read_struct_begin()?;
@@ -4862,7 +5006,7 @@ impl EncryptionAlgorithm {
Ok(ret.expect("return value should have been constructed"))
}
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("EncryptionAlgorithm");
o_prot.write_struct_begin(&struct_ident)?;
match *self {
@@ -4907,17 +5051,17 @@ pub struct FileMetaData {
/// String for application that wrote this file. This should be in the
format
/// `<Application>` version `<App Version>` (build `<App Build Hash>`).
/// e.g. impala version 1.0 (build 6cf94d29b2b7115df4de2c06e2ab4326d721eb55)
- ///
+ ///
pub created_by: Option<String>,
/// Sort order used for the min_value and max_value fields of each column in
/// this file. Sort orders are listed in the order matching the columns in
the
/// schema. The indexes are not necessary the same though, because only leaf
/// nodes of the schema are represented in the list of sort orders.
- ///
+ ///
/// Without column_orders, the meaning of the min_value and max_value fields
is
/// undefined. To ensure well-defined behaviour, if min_value and max_value
are
/// written to a Parquet file, column_orders must be written as well.
- ///
+ ///
/// The obsolete min and max fields are always sorted by signed comparison
/// regardless of column_orders.
pub column_orders: Option<Vec<ColumnOrder>>,
@@ -4944,7 +5088,10 @@ impl FileMetaData {
footer_signing_key_metadata: footer_signing_key_metadata.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<FileMetaData> {
+}
+
+impl TSerializable for FileMetaData {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<FileMetaData> {
i_prot.read_struct_begin()?;
let mut f_1: Option<i32> = None;
let mut f_2: Option<Vec<SchemaElement>> = None;
@@ -5046,7 +5193,7 @@ impl FileMetaData {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("FileMetaData");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("version", TType::I32,
1))?;
@@ -5130,7 +5277,10 @@ impl FileCryptoMetaData {
key_metadata: key_metadata.into(),
}
}
- pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<FileCryptoMetaData> {
+}
+
+impl TSerializable for FileCryptoMetaData {
+ fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) ->
thrift::Result<FileCryptoMetaData> {
i_prot.read_struct_begin()?;
let mut f_1: Option<EncryptionAlgorithm> = None;
let mut f_2: Option<Vec<u8>> = None;
@@ -5163,7 +5313,7 @@ impl FileCryptoMetaData {
};
Ok(ret)
}
- pub fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
+ fn write_to_out_protocol(&self, o_prot: &mut dyn TOutputProtocol) ->
thrift::Result<()> {
let struct_ident = TStructIdentifier::new("FileCryptoMetaData");
o_prot.write_struct_begin(&struct_ident)?;
o_prot.write_field_begin(&TFieldIdentifier::new("encryption_algorithm",
TType::Struct, 1))?;