pub struct PtarsConfig {Show 15 fields
pub timestamp_tz: Option<Arc<str>>,
pub timestamp_unit: TimeUnit,
pub time_unit: TimeUnit,
pub duration_unit: TimeUnit,
pub list_value_name: Arc<str>,
pub map_value_name: Arc<str>,
pub list_nullable: bool,
pub map_nullable: bool,
pub list_value_nullable: bool,
pub map_value_nullable: bool,
pub use_large_string: bool,
pub use_large_binary: bool,
pub use_large_list: bool,
pub enum_repr: EnumRepr,
pub confluent_wire_policy: ConfluentWirePolicy,
}Expand description
Configuration for protobuf to Arrow conversions.
This struct allows customizing how protobuf types are mapped to Arrow types,
similar to Python’s ProtarrowConfig.
Fields§
§timestamp_tz: Option<Arc<str>>Timezone for timestamp values. Default: Some(“UTC”) Set to None for timezone-naive timestamps.
timestamp_unit: TimeUnitTime unit for timestamp values. Default: Nanosecond
time_unit: TimeUnitTime unit for time of day values. Default: Nanosecond
duration_unit: TimeUnitTime unit for duration values. Default: Nanosecond
list_value_name: Arc<str>Name for list item field. Default: “item”
map_value_name: Arc<str>Name for map value field. Default: “value”
list_nullable: boolWhether list fields can be null. Default: false
map_nullable: boolWhether map fields can be null. Default: false
list_value_nullable: boolWhether list element values can be null. Default: false
map_value_nullable: boolWhether map values can be null. Default: false
use_large_string: boolWhether to use LargeUtf8 instead of Utf8 for string fields. Default: false
use_large_binary: boolWhether to use LargeBinary instead of Binary for bytes fields. Default: false
use_large_list: boolWhether to use LargeList instead of List for repeated fields. Default: false
enum_repr: EnumReprHow to represent enum fields in Arrow. Default: Int32 When String, use_large_string controls Utf8 vs LargeUtf8. When Binary, use_large_binary controls Binary vs LargeBinary.
confluent_wire_policy: ConfluentWirePolicyPolicy for stripping Confluent Schema Registry wire format prefix. Default: Raw
Implementations§
Source§impl PtarsConfig
impl PtarsConfig
Sourcepub fn with_timestamp_tz(self, tz: Option<&str>) -> Self
pub fn with_timestamp_tz(self, tz: Option<&str>) -> Self
Set the timezone for timestamp values.
Sourcepub fn with_timestamp_unit(self, unit: TimeUnit) -> Self
pub fn with_timestamp_unit(self, unit: TimeUnit) -> Self
Set the time unit for timestamp values.
Sourcepub fn with_time_unit(self, unit: TimeUnit) -> Self
pub fn with_time_unit(self, unit: TimeUnit) -> Self
Set the time unit for time of day values.
Sourcepub fn with_duration_unit(self, unit: TimeUnit) -> Self
pub fn with_duration_unit(self, unit: TimeUnit) -> Self
Set the time unit for duration values.
Sourcepub fn with_list_value_name(self, name: &str) -> Self
pub fn with_list_value_name(self, name: &str) -> Self
Set the name for list item fields.
Sourcepub fn with_map_value_name(self, name: &str) -> Self
pub fn with_map_value_name(self, name: &str) -> Self
Set the name for map value fields.
Sourcepub fn with_list_nullable(self, nullable: bool) -> Self
pub fn with_list_nullable(self, nullable: bool) -> Self
Set whether list fields can be null.
Sourcepub fn with_map_nullable(self, nullable: bool) -> Self
pub fn with_map_nullable(self, nullable: bool) -> Self
Set whether map fields can be null.
Sourcepub fn with_list_value_nullable(self, nullable: bool) -> Self
pub fn with_list_value_nullable(self, nullable: bool) -> Self
Set whether list element values can be null.
Sourcepub fn with_map_value_nullable(self, nullable: bool) -> Self
pub fn with_map_value_nullable(self, nullable: bool) -> Self
Set whether map values can be null.
Sourcepub fn with_use_large_string(self, use_large: bool) -> Self
pub fn with_use_large_string(self, use_large: bool) -> Self
Set whether to use LargeUtf8 instead of Utf8 for string fields.
Sourcepub fn with_use_large_binary(self, use_large: bool) -> Self
pub fn with_use_large_binary(self, use_large: bool) -> Self
Set whether to use LargeBinary instead of Binary for bytes fields.
Sourcepub fn with_use_large_list(self, use_large: bool) -> Self
pub fn with_use_large_list(self, use_large: bool) -> Self
Set whether to use LargeList instead of List for repeated fields.
Sourcepub fn with_enum_repr(self, repr: EnumRepr) -> Self
pub fn with_enum_repr(self, repr: EnumRepr) -> Self
Set how enum fields are represented in Arrow.
Sourcepub fn with_confluent_wire_policy(self, policy: ConfluentWirePolicy) -> Self
pub fn with_confluent_wire_policy(self, policy: ConfluentWirePolicy) -> Self
Set the Confluent Schema Registry wire format policy.
Trait Implementations§
Source§impl Clone for PtarsConfig
impl Clone for PtarsConfig
Source§fn clone(&self) -> PtarsConfig
fn clone(&self) -> PtarsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more