pub struct WriterBuilder {
schema: Schema,
codec: Option<CompressionCodec>,
capacity: usize,
fingerprint_strategy: Option<FingerprintStrategy>,
}展开描述
用于配置和创建 Writer 的构建器。
字段§
§schema: Schema§codec: Option<CompressionCodec>§capacity: usize§fingerprint_strategy: Option<FingerprintStrategy>实现§
源文件§impl WriterBuilder
impl WriterBuilder
源代码pub fn new(schema: Schema) -> Self
pub fn new(schema: Schema) -> Self
创建一个具有默认设置的新构建器。
用于写入的 Avro 模式(schema)按以下方式确定
- 如果 Arrow 模式元数据包含
avro::schema(参见SCHEMA_METADATA_KEY),则直接使用该 JSON。 - 否则,将 Arrow 模式转换为 Avro 记录模式。
源代码pub fn with_fingerprint_strategy(self, strategy: FingerprintStrategy) -> Self
pub fn with_fingerprint_strategy(self, strategy: FingerprintStrategy) -> Self
设置流写入器的指纹策略。这决定了每条记录的前缀格式。
源代码pub fn with_compression(self, codec: Option<CompressionCodec>) -> Self
pub fn with_compression(self, codec: Option<CompressionCodec>) -> Self
更改压缩编解码器。
源代码pub fn with_capacity(self, capacity: usize) -> Self
pub fn with_capacity(self, capacity: usize) -> Self
设置给定对象的容量并返回修改后的实例。
Trait 实现§
源文件§impl Clone for WriterBuilder
impl Clone for WriterBuilder
源文件§fn clone(&self) -> WriterBuilder
fn clone(&self) -> WriterBuilder
返回值的副本。 阅读更多
1.0.0 · 源§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
执行从
source 的复制赋值。 阅读更多