编解码器

枚举 Codec 

源代码
pub(crate) enum Codec {
Show 29 variants Null, Boolean, Int32, Int64, Float32, Float64, Binary, Utf8, Utf8View, Date32, TimeMillis, TimeMicros, TimestampMillis(bool), TimestampMicros(bool), TimestampNanos(bool), Fixed(i32), Decimal(usize, Option<usize>, Option<usize>), Uuid, Enum(Arc<[String]>), List(Arc<AvroDataType>), Struct(Arc<[AvroField]>), Map(Arc<AvroDataType>), Interval, Union(Arc<[AvroDataType]>, UnionFields, UnionMode), DurationNanos, DurationMicros, DurationMillis, DurationSeconds, RunEndEncoded(Arc<AvroDataType>, u8),
}
展开描述

变体§

§

Null

表示 Avro null 类型,映射到 Arrow 的 Null 数据类型

§

Boolean

表示 Avro boolean 类型,映射到 Arrow 的 Boolean 数据类型

§

Int32

表示 Avro int 类型,映射到 Arrow 的 Int32 数据类型

§

Int64

表示 Avro long 类型,映射到 Arrow 的 Int64 数据类型

§

Float32

表示 Avro float 类型,映射到 Arrow 的 Float32 数据类型

§

Float64

表示 Avro double 类型,映射到 Arrow 的 Float64 数据类型

§

Binary

表示 Avro bytes 类型,映射到 Arrow 的 Binary 数据类型

§

Utf8 字符串

以 UTF-8 编码字节表示的字符串数据,对应于 Arrow 的 StringArray

§

Utf8View

以 UTF-8 编码字节表示的字符串数据,具有优化的视图表示,对应于 Arrow 的 StringViewArray,它为字符串操作提供了更好的性能

可通过 ReadOptions::use_utf8view 启用 Utf8View 选项。

§

Date32

表示 Avro date 逻辑类型,映射到 Arrow 的 Date32 数据类型

§

时间(毫秒)

表示 Avro time-millis 逻辑类型,映射到 Arrow 的 Time32(TimeUnit::Millisecond) 数据类型

§

时间(微秒)

表示 Avro time-micros 逻辑类型,映射到 Arrow 的 Time64(TimeUnit::Microsecond) 数据类型

§

TimestampMillis(bool)(毫秒时间戳 (布尔值))

表示 Avro timestamp-millis 或 local-timestamp-millis 逻辑类型

映射到 Arrow 的 Timestamp(TimeUnit::Millisecond) 数据类型。布尔参数指示时间戳是否具有 UTC 时区 (true) 或为本地时间 (false)

§

TimestampMicros(bool)(微秒时间戳 (布尔值))

表示 Avro timestamp-micros 或 local-timestamp-micros 逻辑类型

映射到 Arrow 的 Timestamp(TimeUnit::Microsecond) 数据类型。布尔参数指示时间戳是否具有 UTC 时区 (true) 或为本地时间 (false)

§

TimestampNanos(bool)(纳秒时间戳 (布尔值))

表示 Avro timestamp-nanos 或 local-timestamp-nanos 逻辑类型

映射到 Arrow 的 Timestamp(TimeUnit::Nanosecond) 数据类型。布尔参数指示时间戳是否具有 UTC 时区 (true) 或为本地时间 (false)

§

Fixed(i32)(固定 (i32))

表示 Avro fixed 类型,映射到 Arrow 的 FixedSizeBinary 数据类型。i32 参数指示固定二进制大小

§

Decimal(usize, Option<usize>, Option<usize>)(十进制 (usize, Option, Option))

表示 Avro decimal 类型,映射到 Arrow 的 Decimal32, Decimal64, Decimal128 或 Decimal256 数据类型

字段为 (precision, scale, fixed_size)

  • precision (usize): 总位数。
  • scale (Option<usize>): 小数位数。
  • fixed_size (Option<usize>): 如果由 fixed 类型支持,则为字节大小,否则为 None
§

Uuid

表示 Avro Uuid 类型,一个长度为 16 的 FixedSizeBinary。

§

Enum(Arc<[String]>)(枚举 (Arc<[String]>))

表示 Avro 枚举,映射到 Arrow 的 Dictionary(Int32, Utf8) 类型。

包含的值是枚举的符号。

§

List(Arc<AvroDataType>)(列表 (Arc))

表示 Avro array 类型,映射到 Arrow 的 List 数据类型

§

Struct(Arc<[AvroField]>)(结构体 (Arc<[AvroField]>))

表示 Avro record 类型,映射到 Arrow 的 Struct 数据类型

§

Map(Arc<AvroDataType>)(映射 (Arc))

表示 Avro map 类型,映射到 Arrow 的 Map 数据类型

§

间隔

表示 Avro duration 逻辑类型,映射到 Arrow 的 Interval(IntervalUnit::MonthDayNano) 数据类型

§

Union(Arc<[AvroDataType]>, UnionFields, UnionMode)(联合 (Arc<[AvroDataType]>, UnionFields, UnionMode))

表示 Avro union 类型,映射到 Arrow 的 Union 数据类型

§

DurationNanos(纳秒时长)

表示 Avro 自定义逻辑类型,映射到 Arrow Duration(TimeUnit::Nanosecond)

§

DurationMicros(微秒时长)

表示 Avro 自定义逻辑类型,映射到 Arrow Duration(TimeUnit::Microsecond)

§

DurationMillis(毫秒时长)

表示 Avro 自定义逻辑类型,映射到 Arrow Duration(TimeUnit::Millisecond)

§

DurationSeconds(秒时长)

表示 Avro 自定义逻辑类型,映射到 Arrow Duration(TimeUnit::Second)

§

RunEndEncoded(Arc<AvroDataType>, u8)(RunEndEncoded (Arc, u8))

实现§

来源§

impl Codec

源代码

fn data_type(&self) -> DataType

源代码

pub(crate) fn with_utf8view(self, use_utf8view: bool) -> Self

如果请求,将字符串编解码器转换为使用 Utf8View

仅当以下两个条件都满足时才会进行转换:

  1. use_utf8view 为 true
  2. 编解码器当前为 Utf8
源代码

fn union_field_name(&self) -> String

Trait 实现§

来源§

impl Clone for Codec

来源§

fn clone(&self) -> Codec

返回值的副本。 阅读更多
1.0.0 · §

fn clone_from(&mut self, source: &Self)

执行从 source 的复制赋值。 阅读更多
来源§

impl Debug for Codec

来源§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

使用给定的格式化程序格式化值。 阅读更多
来源§

impl From<&Codec> for UnionFieldKind

来源§

fn from(c: &Codec) -> Self

从输入类型转换为此类型。
来源§

impl From<PrimitiveType> for Codec

来源§

fn from(value: PrimitiveType) -> Self

从输入类型转换为此类型。
来源§

impl PartialEq for Codec

来源§

fn eq(&self, other: &Codec) -> bool

测试 selfother 值是否相等,并由 == 使用。
1.0.0 · §

fn ne(&self, other: &Rhs) -> bool

测试 !=。默认实现几乎总是足够的,不应在没有充分理由的情况下重写。
来源§

impl StructuralPartialEq for Codec

自动 Trait 实现§

§

impl Freeze for Codec

§

impl RefUnwindSafe for Codec

§

impl Send for Codec

§

impl Sync for Codec

§

impl Unpin for Codec

§

impl UnwindSafe for Codec

通用实现§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

从拥有的值进行不可变借用。 阅读更多
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

从拥有的值进行可变借用。 阅读更多
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬这是一个仅限 nightly 的实验性 API。(clone_to_uninit
执行从 selfdest 的复制赋值。 阅读更多
§

impl<T> From<T> for T

来源§

fn from(t: T) -> T

返回未更改的参数。

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换是 From<T> for U 的实现选择执行的任何操作。

§

impl<T> Same for T

§

type Output = T

应该总是 Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

获取所有权后的结果类型。
§

fn to_owned(&self) -> T

从借用的数据创建拥有的数据,通常通过克隆。 阅读更多
§

fn clone_into(&self, target: &mut T)

使用借用的数据替换拥有的数据,通常通过克隆。 阅读更多
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

转换错误时返回的类型。
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

转换错误时返回的类型。
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行转换。
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,