From d3eeeb4fd4ba171b42e0f9405960f9b4b2b58631 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Mon, 14 Nov 2022 09:14:24 +0800 Subject: [PATCH] test with thrift 0.17 and fix issues --- arrow/src/row/dictionary.rs | 2 +- parquet/Cargo.toml | 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 | 414 +++++++++++++------- 7 files changed, 288 insertions(+), 138 deletions(-) diff --git a/arrow/src/row/dictionary.rs b/arrow/src/row/dictionary.rs index d8426ad0c3e..82169a37d35 100644 --- a/arrow/src/row/dictionary.rs +++ b/arrow/src/row/dictionary.rs @@ -260,7 +260,7 @@ unsafe fn decode_fixed( .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 b400b01a7d1..a474f4f7b68 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", package = "databend-thrift", 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/file/footer.rs b/parquet/src/file/footer.rs index e8a114db75b..27c07b78d7c 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 99877a92105..af23c0bd9f0 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 a400d4dabcb..ebe87aca6d5 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 528f7249419..2efaf7cafc2 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 6fb2e32ebcf..3d38dd53145 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 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let enum_value = i_prot.read_i32()?; Ok(Type::from(enum_value)) } @@ -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 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let enum_value = i_prot.read_i32()?; Ok(Encoding::from(enum_value)) } @@ -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 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let enum_value = i_prot.read_i32()?; Ok(BoundaryOrder::from(enum_value)) } @@ -654,7 +675,10 @@ impl Statistics { min_value: min_value.into(), } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for Statistics { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option> = None; let mut f_2: Option> = 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 { +} + +impl TSerializable for StringType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for UUIDType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for MapType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for ListType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for EnumType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for DateType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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()?; @@ -1049,7 +1091,10 @@ impl NullType { pub fn new() -> NullType { NullType {} } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for NullType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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()?; @@ -1105,7 +1150,10 @@ impl DecimalType { precision, } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for DecimalType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for MilliSeconds { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for MicroSeconds { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for NanoSeconds { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +impl TSerializable for TimeUnit { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { @@ -1408,7 +1465,10 @@ impl TimestampType { unit, } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for TimestampType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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))?; @@ -1476,7 +1536,10 @@ impl TimeType { unit, } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for TimeType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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))?; @@ -1546,7 +1609,10 @@ impl IntType { is_signed, } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for IntType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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))?; @@ -1609,7 +1675,10 @@ impl JsonType { pub fn new() -> JsonType { JsonType {} } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for JsonType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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()?; @@ -1657,7 +1726,10 @@ impl BsonType { pub fn new() -> BsonType { BsonType {} } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for BsonType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +impl TSerializable for LogicalType { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { @@ -1982,7 +2054,10 @@ impl SchemaElement { logical_type: logical_type.into(), } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for SchemaElement { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for DataPageHeader { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for IndexPageHeader { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for DictionaryPageHeader { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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))?; @@ -2399,7 +2483,10 @@ impl DataPageHeaderV2 { statistics: statistics.into(), } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for DataPageHeaderV2 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for SplitBlockAlgorithm { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +impl TSerializable for BloomFilterAlgorithm { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { @@ -2643,7 +2733,10 @@ impl XxHash { pub fn new() -> XxHash { XxHash {} } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for XxHash { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +impl TSerializable for BloomFilterHash { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { @@ -2763,7 +2856,10 @@ impl Uncompressed { pub fn new() -> Uncompressed { Uncompressed {} } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for Uncompressed { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +impl TSerializable for BloomFilterCompression { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { @@ -2897,7 +2993,10 @@ impl BloomFilterHeader { compression, } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for BloomFilterHeader { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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))?; @@ -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 { +} + +impl TSerializable for PageHeader { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for KeyValue { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for SortingColumn { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for PageEncodingStats { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { +} + +impl TSerializable for ColumnMetaData { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option> = 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 { +} + +impl TSerializable for EncryptionWithFooterKey { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +} + +impl TSerializable for EncryptionWithColumnKey { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option> = None; let mut f_2: Option> = 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 { +impl TSerializable for ColumnCryptoMetaData { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { @@ -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 { +} + +impl TSerializable for ColumnChunk { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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 { @@ -4059,7 +4182,10 @@ impl RowGroup { ordinal: ordinal.into(), } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for RowGroup { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option> = None; let mut f_2: Option = 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 { +} + +impl TSerializable for TypeDefinedOrder { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { 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 { +impl TSerializable for ColumnOrder { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { +} + +impl TSerializable for PageLocation { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option = 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))?; @@ -4389,7 +4521,7 @@ impl PageLocation { #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct OffsetIndex { /// PageLocations, ordered by increasing PageLocation.offset. It is required - /// that page_locations\[i\].first_row_index < page_locations\[i+1\].first_row_index. + /// that page_locations[i].first_row_index < page_locations[i+1].first_row_index. pub page_locations: Vec, } @@ -4399,7 +4531,10 @@ impl OffsetIndex { page_locations, } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for OffsetIndex { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option> = 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))?; @@ -4452,27 +4587,27 @@ impl OffsetIndex { // /// Description for ColumnIndex. -/// Each ``\[i\] refers to the page at OffsetIndex.page_locations\[i\] +/// Each [i] refers to the page at OffsetIndex.page_locations[i] #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct ColumnIndex { /// A list of Boolean values to determine the validity of the corresponding /// min and max values. If true, a page contains only null values, and writers /// have to set the corresponding entries in min_values and max_values to - /// byte\[0\], so that all lists have the same length. If false, the + /// byte[0], so that all lists have the same length. If false, the /// corresponding entries in min_values and max_values must be valid. pub null_pages: Vec, /// Two lists containing lower and upper bounds for the values of each page. /// These may be the actual minimum and maximum values found on a page, but /// can also be (more compact) values that do not exist on a page. For /// example, instead of storing ""Blart Versenwald III", a writer may set - /// min_values\[i\]="B", max_values\[i\]="C". Such more compact values must still + /// min_values[i]="B", max_values[i]="C". Such more compact values must still /// be valid values within the column's logical type. Readers must make sure /// that list entries are populated before using them by inspecting null_pages. pub min_values: Vec>, pub max_values: Vec>, /// Stores whether both min_values and max_values are orderd 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 + /// lists. Readers cannot assume that max_values[i] <= min_values[i+1], even /// if the lists are ordered. pub boundary_order: BoundaryOrder, /// A list containing the number of null values for each page * @@ -4489,7 +4624,10 @@ impl ColumnIndex { null_counts: null_counts.into(), } } - pub fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { +} + +impl TSerializable for ColumnIndex { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option> = None; let mut f_2: Option>> = 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 { +} + +impl TSerializable for AesGcmV1 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option> = None; let mut f_2: Option> = 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 { +} + +impl TSerializable for AesGcmCtrV1 { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option> = None; let mut f_2: Option> = 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 { +impl TSerializable for EncryptionAlgorithm { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { let mut ret: Option = 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 { @@ -4905,7 +5049,7 @@ pub struct FileMetaData { /// Optional key/value metadata * pub key_value_metadata: Option>, /// String for application that wrote this file. This should be in the format - /// `` version `` (build ``). + /// version (build ). /// e.g. impala version 1.0 (build 6cf94d29b2b7115df4de2c06e2ab4326d721eb55) /// pub created_by: Option, @@ -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 { +} + +impl TSerializable for FileMetaData { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option> = 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 { +} + +impl TSerializable for FileCryptoMetaData { + fn read_from_in_protocol(i_prot: &mut dyn TInputProtocol) -> thrift::Result { i_prot.read_struct_begin()?; let mut f_1: Option = None; let mut f_2: Option> = 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))?;