You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by gi...@apache.org on 2025/03/11 09:18:05 UTC
(iceberg-rust) branch gh-pages updated: deploy: 6c6ef7470b015dcafa5a2eb3f90709a0168f2a18
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git
The following commit(s) were added to refs/heads/gh-pages by this push:
new e49858bb deploy: 6c6ef7470b015dcafa5a2eb3f90709a0168f2a18
e49858bb is described below
commit e49858bb62d56cac465eacc47854d80294e43e7b
Author: liurenjie1024 <li...@users.noreply.github.com>
AuthorDate: Tue Mar 11 09:18:00 2025 +0000
deploy: 6c6ef7470b015dcafa5a2eb3f90709a0168f2a18
---
api/help.html | 2 +-
api/iceberg/writer/index.html | 192 ++++++++++--
api/iceberg/writer/trait.CurrentFileStatus.html | 8 +-
api/iceberg/writer/trait.IcebergWriter.html | 6 +-
api/iceberg/writer/trait.IcebergWriterBuilder.html | 6 +-
api/settings.html | 2 +-
api/src/iceberg/writer/mod.rs.html | 342 +++++++++++++++++++--
7 files changed, 499 insertions(+), 59 deletions(-)
diff --git a/api/help.html b/api/help.html
index b3855f23..21943ce1 100644
--- a/api/help.html
+++ b/api/help.html
@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-5 [...]
\ No newline at end of file
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-5 [...]
\ No newline at end of file
diff --git a/api/iceberg/writer/index.html b/api/iceberg/writer/index.html
index 42aece5d..752791d2 100644
--- a/api/iceberg/writer/index.html
+++ b/api/iceberg/writer/index.html
@@ -1,28 +1,172 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Iceberg writer module."><title>iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCo [...]
-<p>The writer API is designed to be extensible and flexible. Each writer is decoupled and can be create and config independently. User can:
-1.Customize the writer using the writer trait.
-2.Combine different writer to build a writer which have complex write logic.</p>
-<p>There are two kinds of writer:</p>
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Iceberg writer module."><title>iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCo [...]
+<p>This module contains the generic writer trait and specific writer implementation. We categorize the writer into two types:</p>
<ol>
-<li>FileWriter: Focus on writing record batch to different physical file format.(Such as parquet. orc)</li>
-<li>IcebergWriter: Focus on the logical format of iceberg table. It will write the data using the FileWriter finally.</li>
+<li>FileWriter: writer for physical file format (Such as parquet, orc).</li>
+<li>IcebergWriter: writer for logical format provided by iceberg table (Such as data file, equality delete file, position delete file)
+or other function (Such as partition writer, delta writer).</li>
</ol>
-<h2 id="simple-example-for-data-file-writer"><a class="doc-anchor" href="#simple-example-for-data-file-writer">§</a>Simple example for data file writer:</h2>
-<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="comment">// Create a parquet file writer builder. The parameter can get from table.
-</span><span class="kw">let </span>file_writer_builder = ParquetWriterBuilder::new(
- <span class="number">0</span>,
- WriterProperties::builder().build(),
- schema,
- file_io.clone(),
- loccation_gen,
- file_name_gen,
-)
-<span class="comment">// Create a data file writer using parquet file writer builder.
-</span><span class="kw">let </span>data_file_builder = DataFileBuilder::new(file_writer_builder);
-<span class="comment">// Build the data file writer.
-</span><span class="kw">let </span>data_file_writer = data_file_builder.build().<span class="kw">await</span>.unwrap();
-
-data_file_writer.write(<span class="kw-2">&</span>record_batch).<span class="kw">await</span>.unwrap();
-<span class="kw">let </span>data_files = data_file_writer.flush().<span class="kw">await</span>.unwrap();</code></pre></div>
+<p>The IcebergWriter will use FileWriter to write underly physical file.</p>
+<p>We hope the writer interface can be extensible and flexible. Each writer can be create config independently
+and combined together to build a writer which have complex write logic. E.g. combine <code>FanoutPartitionWriter</code>, <code>DataFileWriter</code>, <code>ParquetWriter</code> to get
+a writer can split the data automatelly according to partition and write down as parquet physical format.</p>
+<p>For this purpose, there are four trait corresponding to these writer:</p>
+<ul>
+<li>IcebergWriterBuilder</li>
+<li>IcebergWriter</li>
+<li>FileWriterBuilder</li>
+<li>FileWriter</li>
+</ul>
+<p>User can create specific writer builder, combine them and build the writer finally. Also user can custom
+own writer and implement writer trait for them so that the custom writer can integrate with existing writer. (See following example)</p>
+<h2 id="simple-example-for-the-data-file-writer-used-parquet-physical-format"><a class="doc-anchor" href="#simple-example-for-the-data-file-writer-used-parquet-physical-format">§</a>Simple example for the data file writer used parquet physical format:</h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::sync::Arc;
+
+<span class="kw">use </span>arrow_array::{ArrayRef, BooleanArray, Int32Array, RecordBatch, StringArray};
+<span class="kw">use </span>async_trait::async_trait;
+<span class="kw">use </span>iceberg::io::{FileIO, FileIOBuilder};
+<span class="kw">use </span>iceberg::spec::DataFile;
+<span class="kw">use </span>iceberg::transaction::Transaction;
+<span class="kw">use </span>iceberg::writer::base_writer::data_file_writer::DataFileWriterBuilder;
+<span class="kw">use </span>iceberg::writer::file_writer::location_generator::{
+ DefaultFileNameGenerator, DefaultLocationGenerator,
+};
+<span class="kw">use </span>iceberg::writer::file_writer::ParquetWriterBuilder;
+<span class="kw">use </span>iceberg::writer::{IcebergWriter, IcebergWriterBuilder};
+<span class="kw">use </span>iceberg::{Catalog, <span class="prelude-ty">Result</span>, TableIdent};
+<span class="kw">use </span>iceberg_catalog_memory::MemoryCatalog;
+<span class="kw">use </span>parquet::file::properties::WriterProperties;
+<span class="attr">#[tokio::main]
+</span><span class="kw">async fn </span>main() -> <span class="prelude-ty">Result</span><()> {
+ <span class="comment">// Build your file IO.
+ </span><span class="kw">let </span>file_io = FileIOBuilder::new(<span class="string">"memory"</span>).build()<span class="question-mark">?</span>;
+ <span class="comment">// Connect to a catalog.
+ </span><span class="kw">let </span>catalog = MemoryCatalog::new(file_io, <span class="prelude-val">None</span>);
+ <span class="comment">// Load table from catalog.
+ </span><span class="kw">let </span>table = catalog
+ .load_table(<span class="kw-2">&</span>TableIdent::from_strs([<span class="string">"hello"</span>, <span class="string">"world"</span>])<span class="question-mark">?</span>)
+ .<span class="kw">await</span><span class="question-mark">?</span>;
+ <span class="kw">let </span>location_generator = DefaultLocationGenerator::new(table.metadata().clone()).unwrap();
+ <span class="kw">let </span>file_name_generator = DefaultFileNameGenerator::new(
+ <span class="string">"test"</span>.to_string(),
+ <span class="prelude-val">None</span>,
+ iceberg::spec::DataFileFormat::Parquet,
+ );
+
+ <span class="comment">// Create a parquet file writer builder. The parameter can get from table.
+ </span><span class="kw">let </span>parquet_writer_builder = ParquetWriterBuilder::new(
+ WriterProperties::default(),
+ table.metadata().current_schema().clone(),
+ table.file_io().clone(),
+ location_generator.clone(),
+ file_name_generator.clone(),
+ );
+ <span class="comment">// Create a data file writer using parquet file writer builder.
+ </span><span class="kw">let </span>data_file_writer_builder = DataFileWriterBuilder::new(parquet_writer_builder, <span class="prelude-val">None</span>);
+ <span class="comment">// Build the data file writer
+ </span><span class="kw">let </span><span class="kw-2">mut </span>data_file_writer = data_file_writer_builder.build().<span class="kw">await</span>.unwrap();
+
+ <span class="comment">// Write the data using data_file_writer...
+
+ // Close the write and it will return data files back
+ </span><span class="kw">let </span>data_files = data_file_writer.close().<span class="kw">await</span>.unwrap();
+
+ <span class="prelude-val">Ok</span>(())
+}</code></pre></div>
+<h2 id="custom-writer-to-record-latency"><a class="doc-anchor" href="#custom-writer-to-record-latency">§</a>Custom writer to record latency</h2>
+<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::time::Instant;
+
+<span class="kw">use </span>arrow_array::RecordBatch;
+<span class="kw">use </span>iceberg::io::FileIOBuilder;
+<span class="kw">use </span>iceberg::spec::DataFile;
+<span class="kw">use </span>iceberg::writer::base_writer::data_file_writer::DataFileWriterBuilder;
+<span class="kw">use </span>iceberg::writer::file_writer::location_generator::{
+ DefaultFileNameGenerator, DefaultLocationGenerator,
+};
+<span class="kw">use </span>iceberg::writer::file_writer::ParquetWriterBuilder;
+<span class="kw">use </span>iceberg::writer::{IcebergWriter, IcebergWriterBuilder};
+<span class="kw">use </span>iceberg::{Catalog, <span class="prelude-ty">Result</span>, TableIdent};
+<span class="kw">use </span>iceberg_catalog_memory::MemoryCatalog;
+<span class="kw">use </span>parquet::file::properties::WriterProperties;
+
+<span class="attr">#[derive(Clone)]
+</span><span class="kw">struct </span>LatencyRecordWriterBuilder<B> {
+ inner_writer_builder: B,
+}
+
+<span class="kw">impl</span><B: IcebergWriterBuilder> LatencyRecordWriterBuilder<B> {
+ <span class="kw">pub fn </span>new(inner_writer_builder: B) -> <span class="self">Self </span>{
+ <span class="self">Self </span>{
+ inner_writer_builder,
+ }
+ }
+}
+
+<span class="attr">#[async_trait::async_trait]
+</span><span class="kw">impl</span><B: IcebergWriterBuilder> IcebergWriterBuilder <span class="kw">for </span>LatencyRecordWriterBuilder<B> {
+ <span class="kw">type </span>R = LatencyRecordWriter<B::R>;
+
+ <span class="kw">async fn </span>build(<span class="self">self</span>) -> <span class="prelude-ty">Result</span><<span class="self">Self</span>::R> {
+ <span class="prelude-val">Ok</span>(LatencyRecordWriter {
+ inner_writer: <span class="self">self</span>.inner_writer_builder.build().<span class="kw">await</span><span class="question-mark">?</span>,
+ })
+ }
+}
+<span class="kw">struct </span>LatencyRecordWriter<W> {
+ inner_writer: W,
+}
+
+<span class="attr">#[async_trait::async_trait]
+</span><span class="kw">impl</span><W: IcebergWriter> IcebergWriter <span class="kw">for </span>LatencyRecordWriter<W> {
+ <span class="kw">async fn </span>write(<span class="kw-2">&mut </span><span class="self">self</span>, input: RecordBatch) -> <span class="prelude-ty">Result</span><()> {
+ <span class="kw">let </span>start = Instant::now();
+ <span class="self">self</span>.inner_writer.write(input).<span class="kw">await</span><span class="question-mark">?</span>;
+ <span class="kw">let </span>_latency = start.elapsed();
+ <span class="comment">// record latency...
+ </span><span class="prelude-val">Ok</span>(())
+ }
+
+ <span class="kw">async fn </span>close(<span class="kw-2">&mut </span><span class="self">self</span>) -> <span class="prelude-ty">Result</span><Vec<DataFile>> {
+ <span class="kw">let </span>start = Instant::now();
+ <span class="kw">let </span>res = <span class="self">self</span>.inner_writer.close().<span class="kw">await</span><span class="question-mark">?</span>;
+ <span class="kw">let </span>_latency = start.elapsed();
+ <span class="comment">// record latency...
+ </span><span class="prelude-val">Ok</span>(res)
+ }
+}
+
+<span class="attr">#[tokio::main]
+</span><span class="kw">async fn </span>main() -> <span class="prelude-ty">Result</span><()> {
+ <span class="comment">// Build your file IO.
+ </span><span class="kw">let </span>file_io = FileIOBuilder::new(<span class="string">"memory"</span>).build()<span class="question-mark">?</span>;
+ <span class="comment">// Connect to a catalog.
+ </span><span class="kw">let </span>catalog = MemoryCatalog::new(file_io, <span class="prelude-val">None</span>);
+ <span class="comment">// Load table from catalog.
+ </span><span class="kw">let </span>table = catalog
+ .load_table(<span class="kw-2">&</span>TableIdent::from_strs([<span class="string">"hello"</span>, <span class="string">"world"</span>])<span class="question-mark">?</span>)
+ .<span class="kw">await</span><span class="question-mark">?</span>;
+ <span class="kw">let </span>location_generator = DefaultLocationGenerator::new(table.metadata().clone()).unwrap();
+ <span class="kw">let </span>file_name_generator = DefaultFileNameGenerator::new(
+ <span class="string">"test"</span>.to_string(),
+ <span class="prelude-val">None</span>,
+ iceberg::spec::DataFileFormat::Parquet,
+ );
+
+ <span class="comment">// Create a parquet file writer builder. The parameter can get from table.
+ </span><span class="kw">let </span>parquet_writer_builder = ParquetWriterBuilder::new(
+ WriterProperties::default(),
+ table.metadata().current_schema().clone(),
+ table.file_io().clone(),
+ location_generator.clone(),
+ file_name_generator.clone(),
+ );
+ <span class="comment">// Create a data file writer builder using parquet file writer builder.
+ </span><span class="kw">let </span>data_file_writer_builder = DataFileWriterBuilder::new(parquet_writer_builder, <span class="prelude-val">None</span>);
+ <span class="comment">// Create latency record writer using data file writer builder.
+ </span><span class="kw">let </span>latency_record_builder = LatencyRecordWriterBuilder::new(data_file_writer_builder);
+ <span class="comment">// Build the final writer
+ </span><span class="kw">let </span><span class="kw-2">mut </span>latency_record_data_file_writer = latency_record_builder.build().<span class="kw">await</span>.unwrap();
+
+ <span class="prelude-val">Ok</span>(())
+}</code></pre></div>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="base_writer/index.html" title="mod iceberg::writer::base_writer">base_writer</a></div><div class="desc docblock-short">Base writer module contains the basic writer provide by iceberg: <code>DataFileWriter</code>, <code>PositionDeleteFileWriter</code>, <code>EqualityDeleteFileWriter</code>.</div></li><li><div clas [...]
file.</div></li><li><div class="item-name"><a class="trait" href="trait.IcebergWriter.html" title="trait iceberg::writer::IcebergWriter">IcebergWriter</a></div><div class="desc docblock-short">The iceberg writer used to write data to iceberg table.</div></li><li><div class="item-name"><a class="trait" href="trait.IcebergWriterBuilder.html" title="trait iceberg::writer::IcebergWriterBuilder">IcebergWriterBuilder</a></div><div class="desc docblock-short">The builder for iceberg writer.</di [...]
\ No newline at end of file
diff --git a/api/iceberg/writer/trait.CurrentFileStatus.html b/api/iceberg/writer/trait.CurrentFileStatus.html
index c788baee..a6b5facf 100644
--- a/api/iceberg/writer/trait.CurrentFileStatus.html
+++ b/api/iceberg/writer/trait.CurrentFileStatus.html
@@ -1,11 +1,11 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The current file status of iceberg writer. It implement for the writer which write a single file."><title>CurrentFileStatus in iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.t [...]
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The current file status of iceberg writer. It implement for the writer which write a single file."><title>CurrentFileStatus in iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.t [...]
// Required methods
fn <a href="#tymethod.current_file_path" class="fn">current_file_path</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.current_row_num" class="fn">current_row_num</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.current_written_size" class="fn">current_written_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The current file status of iceberg writer. It implement for the writer which write a single
file.</p>
-</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.current_file_path" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#86">source</a><h4 class="code-header">fn <a href="#tymethod.current_file_path" class="fn">current_file_path</a>(&self) -> <a class="struct" href="https:// [...]
-</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.current_row_num" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#88">source</a><h4 class="code-header">fn <a href="#tymethod.current_row_num" class="fn">current_row_num</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Get the current file row number.</p>
-</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.current_written_size" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#90">source</a><h4 class="code-header">fn <a href="#tymethod.current_written_size" class="fn">current_written_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Get the current [...]
+</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.current_file_path" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#234">source</a><h4 class="code-header">fn <a href="#tymethod.current_file_path" class="fn">current_file_path</a>(&self) -> <a class="struct" href="https:/ [...]
+</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.current_row_num" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#236">source</a><h4 class="code-header">fn <a href="#tymethod.current_row_num" class="fn">current_row_num</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Get the current file row number.</p>
+</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.current_written_size" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#238">source</a><h4 class="code-header">fn <a href="#tymethod.current_written_size" class="fn">current_written_size</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></h4></section></summary><div class="docblock"><p>Get the current [...]
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-CurrentFileStatus-for-ParquetWriter" class="impl"><a class="src rightside" href="../../src/iceberg/writer/file_writer/parquet_writer.rs.html#573-585">source</a><a href="#impl-CurrentFileStatus-for-ParquetWriter" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.CurrentFileStatus.html" titl [...]
\ No newline at end of file
diff --git a/api/iceberg/writer/trait.IcebergWriter.html b/api/iceberg/writer/trait.IcebergWriter.html
index 8f2c8126..c9ef150c 100644
--- a/api/iceberg/writer/trait.IcebergWriter.html
+++ b/api/iceberg/writer/trait.IcebergWriter.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The iceberg writer used to write data to iceberg table."><title>IcebergWriter in iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.wof [...]
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The iceberg writer used to write data to iceberg table."><title>IcebergWriter in iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.wof [...]
// Required methods
fn <a href="#tymethod.write" class="fn">write</a><'life0, 'async_trait>(
&'life0 mut self,
@@ -12,13 +12,13 @@
<span class="where">where Self: 'async_trait,
'life0: 'async_trait</span>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The iceberg writer used to write data to iceberg table.</p>
-</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.write" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#74">source</a><h4 class="code-header">fn <a href="#tymethod.write" class="fn">write</a><'life0, 'async_trait>(
+</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.write" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#222">source</a><h4 class="code-header">fn <a href="#tymethod.write" class="fn">write</a><'life0, 'async_trait>(
&'life0 mut self,
input: I,
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../type.Result.html" title="type iceberg: [...]
Self: 'async_trait,
'life0: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Write data to iceberg table.</p>
-</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.close" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#79">source</a><h4 class="code-header">fn <a href="#tymethod.close" class="fn">close</a><'life0, 'async_trait>(
+</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.close" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#227">source</a><h4 class="code-header">fn <a href="#tymethod.close" class="fn">close</a><'life0, 'async_trait>(
&'life0 mut self,
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../type.Result.html" title="type iceberg: [...]
Self: 'async_trait,
diff --git a/api/iceberg/writer/trait.IcebergWriterBuilder.html b/api/iceberg/writer/trait.IcebergWriterBuilder.html
index 99febbaf..29a3dff6 100644
--- a/api/iceberg/writer/trait.IcebergWriterBuilder.html
+++ b/api/iceberg/writer/trait.IcebergWriterBuilder.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The builder for iceberg writer."><title>IcebergWriterBuilder in iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Mediu [...]
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The builder for iceberg writer."><title>IcebergWriterBuilder in iceberg::writer - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Mediu [...]
type <a href="#associatedtype.R" class="associatedtype">R</a>: <a class="trait" href="trait.IcebergWriter.html" title="trait iceberg::writer::IcebergWriter">IcebergWriter</a><I, O>;
// Required method
@@ -7,8 +7,8 @@
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../type.Result.html" title="type iceb [...]
<span class="where">where Self: 'async_trait</span>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The builder for iceberg writer.</p>
-</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.R" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#65">source</a><h4 class="code-header">type <a href="#associatedtype.R" class="associatedtype">R</a>: <a class="trait" href="trait.IcebergWriter.html" title="t [...]
-</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.build" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#67">source</a><h4 class="code-header">fn <a href="#tymethod.build" class="fn">build</a><'async_trait>(
+</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.R" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#213">source</a><h4 class="code-header">type <a href="#associatedtype.R" class="associatedtype">R</a>: <a class="trait" href="trait.IcebergWriter.html" title=" [...]
+</div></details></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.build" class="method"><a class="src rightside" href="../../src/iceberg/writer/mod.rs.html#215">source</a><h4 class="code-header">fn <a href="#tymethod.build" class="fn">build</a><'async_trait>(
self,
) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/pin/struct.Pin.html" title="struct core::pin::Pin">Pin</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a><Output = <a class="type" href="../type.Result.html" title="type iceberg: [...]
Self: 'async_trait,</div></h4></section></summary><div class="docblock"><p>Build the iceberg writer.</p>
diff --git a/api/settings.html b/api/settings.html
index 0b4d7eab..8bb04340 100644
--- a/api/settings.html
+++ b/api/settings.html
@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Settings of Rustdoc"><title>Settings</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562 [...]
\ No newline at end of file
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Settings of Rustdoc"><title>Settings</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562 [...]
\ No newline at end of file
diff --git a/api/src/iceberg/writer/mod.rs.html b/api/src/iceberg/writer/mod.rs.html
index 17b413c9..31a22ae7 100644
--- a/api/src/iceberg/writer/mod.rs.html
+++ b/api/src/iceberg/writer/mod.rs.html
@@ -132,6 +132,154 @@
<a href="#132" id="132">132</a>
<a href="#133" id="133">133</a>
<a href="#134" id="134">134</a>
+<a href="#135" id="135">135</a>
+<a href="#136" id="136">136</a>
+<a href="#137" id="137">137</a>
+<a href="#138" id="138">138</a>
+<a href="#139" id="139">139</a>
+<a href="#140" id="140">140</a>
+<a href="#141" id="141">141</a>
+<a href="#142" id="142">142</a>
+<a href="#143" id="143">143</a>
+<a href="#144" id="144">144</a>
+<a href="#145" id="145">145</a>
+<a href="#146" id="146">146</a>
+<a href="#147" id="147">147</a>
+<a href="#148" id="148">148</a>
+<a href="#149" id="149">149</a>
+<a href="#150" id="150">150</a>
+<a href="#151" id="151">151</a>
+<a href="#152" id="152">152</a>
+<a href="#153" id="153">153</a>
+<a href="#154" id="154">154</a>
+<a href="#155" id="155">155</a>
+<a href="#156" id="156">156</a>
+<a href="#157" id="157">157</a>
+<a href="#158" id="158">158</a>
+<a href="#159" id="159">159</a>
+<a href="#160" id="160">160</a>
+<a href="#161" id="161">161</a>
+<a href="#162" id="162">162</a>
+<a href="#163" id="163">163</a>
+<a href="#164" id="164">164</a>
+<a href="#165" id="165">165</a>
+<a href="#166" id="166">166</a>
+<a href="#167" id="167">167</a>
+<a href="#168" id="168">168</a>
+<a href="#169" id="169">169</a>
+<a href="#170" id="170">170</a>
+<a href="#171" id="171">171</a>
+<a href="#172" id="172">172</a>
+<a href="#173" id="173">173</a>
+<a href="#174" id="174">174</a>
+<a href="#175" id="175">175</a>
+<a href="#176" id="176">176</a>
+<a href="#177" id="177">177</a>
+<a href="#178" id="178">178</a>
+<a href="#179" id="179">179</a>
+<a href="#180" id="180">180</a>
+<a href="#181" id="181">181</a>
+<a href="#182" id="182">182</a>
+<a href="#183" id="183">183</a>
+<a href="#184" id="184">184</a>
+<a href="#185" id="185">185</a>
+<a href="#186" id="186">186</a>
+<a href="#187" id="187">187</a>
+<a href="#188" id="188">188</a>
+<a href="#189" id="189">189</a>
+<a href="#190" id="190">190</a>
+<a href="#191" id="191">191</a>
+<a href="#192" id="192">192</a>
+<a href="#193" id="193">193</a>
+<a href="#194" id="194">194</a>
+<a href="#195" id="195">195</a>
+<a href="#196" id="196">196</a>
+<a href="#197" id="197">197</a>
+<a href="#198" id="198">198</a>
+<a href="#199" id="199">199</a>
+<a href="#200" id="200">200</a>
+<a href="#201" id="201">201</a>
+<a href="#202" id="202">202</a>
+<a href="#203" id="203">203</a>
+<a href="#204" id="204">204</a>
+<a href="#205" id="205">205</a>
+<a href="#206" id="206">206</a>
+<a href="#207" id="207">207</a>
+<a href="#208" id="208">208</a>
+<a href="#209" id="209">209</a>
+<a href="#210" id="210">210</a>
+<a href="#211" id="211">211</a>
+<a href="#212" id="212">212</a>
+<a href="#213" id="213">213</a>
+<a href="#214" id="214">214</a>
+<a href="#215" id="215">215</a>
+<a href="#216" id="216">216</a>
+<a href="#217" id="217">217</a>
+<a href="#218" id="218">218</a>
+<a href="#219" id="219">219</a>
+<a href="#220" id="220">220</a>
+<a href="#221" id="221">221</a>
+<a href="#222" id="222">222</a>
+<a href="#223" id="223">223</a>
+<a href="#224" id="224">224</a>
+<a href="#225" id="225">225</a>
+<a href="#226" id="226">226</a>
+<a href="#227" id="227">227</a>
+<a href="#228" id="228">228</a>
+<a href="#229" id="229">229</a>
+<a href="#230" id="230">230</a>
+<a href="#231" id="231">231</a>
+<a href="#232" id="232">232</a>
+<a href="#233" id="233">233</a>
+<a href="#234" id="234">234</a>
+<a href="#235" id="235">235</a>
+<a href="#236" id="236">236</a>
+<a href="#237" id="237">237</a>
+<a href="#238" id="238">238</a>
+<a href="#239" id="239">239</a>
+<a href="#240" id="240">240</a>
+<a href="#241" id="241">241</a>
+<a href="#242" id="242">242</a>
+<a href="#243" id="243">243</a>
+<a href="#244" id="244">244</a>
+<a href="#245" id="245">245</a>
+<a href="#246" id="246">246</a>
+<a href="#247" id="247">247</a>
+<a href="#248" id="248">248</a>
+<a href="#249" id="249">249</a>
+<a href="#250" id="250">250</a>
+<a href="#251" id="251">251</a>
+<a href="#252" id="252">252</a>
+<a href="#253" id="253">253</a>
+<a href="#254" id="254">254</a>
+<a href="#255" id="255">255</a>
+<a href="#256" id="256">256</a>
+<a href="#257" id="257">257</a>
+<a href="#258" id="258">258</a>
+<a href="#259" id="259">259</a>
+<a href="#260" id="260">260</a>
+<a href="#261" id="261">261</a>
+<a href="#262" id="262">262</a>
+<a href="#263" id="263">263</a>
+<a href="#264" id="264">264</a>
+<a href="#265" id="265">265</a>
+<a href="#266" id="266">266</a>
+<a href="#267" id="267">267</a>
+<a href="#268" id="268">268</a>
+<a href="#269" id="269">269</a>
+<a href="#270" id="270">270</a>
+<a href="#271" id="271">271</a>
+<a href="#272" id="272">272</a>
+<a href="#273" id="273">273</a>
+<a href="#274" id="274">274</a>
+<a href="#275" id="275">275</a>
+<a href="#276" id="276">276</a>
+<a href="#277" id="277">277</a>
+<a href="#278" id="278">278</a>
+<a href="#279" id="279">279</a>
+<a href="#280" id="280">280</a>
+<a href="#281" id="281">281</a>
+<a href="#282" id="282">282</a>
</pre></div><pre class="rust"><code><span class="comment">// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
@@ -151,32 +299,180 @@
</span><span class="doccomment">//! Iceberg writer module.
//!
-//! The writer API is designed to be extensible and flexible. Each writer is decoupled and can be create and config independently. User can:
-//! 1.Customize the writer using the writer trait.
-//! 2.Combine different writer to build a writer which have complex write logic.
+//! This module contains the generic writer trait and specific writer implementation. We categorize the writer into two types:
+//! 1. FileWriter: writer for physical file format (Such as parquet, orc).
+//! 2. IcebergWriter: writer for logical format provided by iceberg table (Such as data file, equality delete file, position delete file)
+//! or other function (Such as partition writer, delta writer).
//!
-//! There are two kinds of writer:
-//! 1. FileWriter: Focus on writing record batch to different physical file format.(Such as parquet. orc)
-//! 2. IcebergWriter: Focus on the logical format of iceberg table. It will write the data using the FileWriter finally.
+//! The IcebergWriter will use FileWriter to write underly physical file.
//!
-//! # Simple example for data file writer:
-//! ```ignore
-//! // Create a parquet file writer builder. The parameter can get from table.
-//! let file_writer_builder = ParquetWriterBuilder::new(
-//! 0,
-//! WriterProperties::builder().build(),
-//! schema,
-//! file_io.clone(),
-//! loccation_gen,
-//! file_name_gen,
-//! )
-//! // Create a data file writer using parquet file writer builder.
-//! let data_file_builder = DataFileBuilder::new(file_writer_builder);
-//! // Build the data file writer.
-//! let data_file_writer = data_file_builder.build().await.unwrap();
+//! We hope the writer interface can be extensible and flexible. Each writer can be create config independently
+//! and combined together to build a writer which have complex write logic. E.g. combine `FanoutPartitionWriter`, `DataFileWriter`, `ParquetWriter` to get
+//! a writer can split the data automatelly according to partition and write down as parquet physical format.
//!
-//! data_file_writer.write(&record_batch).await.unwrap();
-//! let data_files = data_file_writer.flush().await.unwrap();
+//! For this purpose, there are four trait corresponding to these writer:
+//! - IcebergWriterBuilder
+//! - IcebergWriter
+//! - FileWriterBuilder
+//! - FileWriter
+//!
+//! User can create specific writer builder, combine them and build the writer finally. Also user can custom
+//! own writer and implement writer trait for them so that the custom writer can integrate with existing writer. (See following example)
+//!
+//! # Simple example for the data file writer used parquet physical format:
+//! ```rust, no_run
+//! use std::sync::Arc;
+//!
+//! use arrow_array::{ArrayRef, BooleanArray, Int32Array, RecordBatch, StringArray};
+//! use async_trait::async_trait;
+//! use iceberg::io::{FileIO, FileIOBuilder};
+//! use iceberg::spec::DataFile;
+//! use iceberg::transaction::Transaction;
+//! use iceberg::writer::base_writer::data_file_writer::DataFileWriterBuilder;
+//! use iceberg::writer::file_writer::location_generator::{
+//! DefaultFileNameGenerator, DefaultLocationGenerator,
+//! };
+//! use iceberg::writer::file_writer::ParquetWriterBuilder;
+//! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder};
+//! use iceberg::{Catalog, Result, TableIdent};
+//! use iceberg_catalog_memory::MemoryCatalog;
+//! use parquet::file::properties::WriterProperties;
+//! #[tokio::main]
+//! async fn main() -> Result<()> {
+//! // Build your file IO.
+//! let file_io = FileIOBuilder::new("memory").build()?;
+//! // Connect to a catalog.
+//! let catalog = MemoryCatalog::new(file_io, None);
+//! // Load table from catalog.
+//! let table = catalog
+//! .load_table(&TableIdent::from_strs(["hello", "world"])?)
+//! .await?;
+//! let location_generator = DefaultLocationGenerator::new(table.metadata().clone()).unwrap();
+//! let file_name_generator = DefaultFileNameGenerator::new(
+//! "test".to_string(),
+//! None,
+//! iceberg::spec::DataFileFormat::Parquet,
+//! );
+//!
+//! // Create a parquet file writer builder. The parameter can get from table.
+//! let parquet_writer_builder = ParquetWriterBuilder::new(
+//! WriterProperties::default(),
+//! table.metadata().current_schema().clone(),
+//! table.file_io().clone(),
+//! location_generator.clone(),
+//! file_name_generator.clone(),
+//! );
+//! // Create a data file writer using parquet file writer builder.
+//! let data_file_writer_builder = DataFileWriterBuilder::new(parquet_writer_builder, None);
+//! // Build the data file writer
+//! let mut data_file_writer = data_file_writer_builder.build().await.unwrap();
+//!
+//! // Write the data using data_file_writer...
+//!
+//! // Close the write and it will return data files back
+//! let data_files = data_file_writer.close().await.unwrap();
+//!
+//! Ok(())
+//! }
+//! ```
+//!
+//! # Custom writer to record latency
+//! ```rust, no_run
+//! use std::time::Instant;
+//!
+//! use arrow_array::RecordBatch;
+//! use iceberg::io::FileIOBuilder;
+//! use iceberg::spec::DataFile;
+//! use iceberg::writer::base_writer::data_file_writer::DataFileWriterBuilder;
+//! use iceberg::writer::file_writer::location_generator::{
+//! DefaultFileNameGenerator, DefaultLocationGenerator,
+//! };
+//! use iceberg::writer::file_writer::ParquetWriterBuilder;
+//! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder};
+//! use iceberg::{Catalog, Result, TableIdent};
+//! use iceberg_catalog_memory::MemoryCatalog;
+//! use parquet::file::properties::WriterProperties;
+//!
+//! #[derive(Clone)]
+//! struct LatencyRecordWriterBuilder<B> {
+//! inner_writer_builder: B,
+//! }
+//!
+//! impl<B: IcebergWriterBuilder> LatencyRecordWriterBuilder<B> {
+//! pub fn new(inner_writer_builder: B) -> Self {
+//! Self {
+//! inner_writer_builder,
+//! }
+//! }
+//! }
+//!
+//! #[async_trait::async_trait]
+//! impl<B: IcebergWriterBuilder> IcebergWriterBuilder for LatencyRecordWriterBuilder<B> {
+//! type R = LatencyRecordWriter<B::R>;
+//!
+//! async fn build(self) -> Result<Self::R> {
+//! Ok(LatencyRecordWriter {
+//! inner_writer: self.inner_writer_builder.build().await?,
+//! })
+//! }
+//! }
+//! struct LatencyRecordWriter<W> {
+//! inner_writer: W,
+//! }
+//!
+//! #[async_trait::async_trait]
+//! impl<W: IcebergWriter> IcebergWriter for LatencyRecordWriter<W> {
+//! async fn write(&mut self, input: RecordBatch) -> Result<()> {
+//! let start = Instant::now();
+//! self.inner_writer.write(input).await?;
+//! let _latency = start.elapsed();
+//! // record latency...
+//! Ok(())
+//! }
+//!
+//! async fn close(&mut self) -> Result<Vec<DataFile>> {
+//! let start = Instant::now();
+//! let res = self.inner_writer.close().await?;
+//! let _latency = start.elapsed();
+//! // record latency...
+//! Ok(res)
+//! }
+//! }
+//!
+//! #[tokio::main]
+//! async fn main() -> Result<()> {
+//! // Build your file IO.
+//! let file_io = FileIOBuilder::new("memory").build()?;
+//! // Connect to a catalog.
+//! let catalog = MemoryCatalog::new(file_io, None);
+//! // Load table from catalog.
+//! let table = catalog
+//! .load_table(&TableIdent::from_strs(["hello", "world"])?)
+//! .await?;
+//! let location_generator = DefaultLocationGenerator::new(table.metadata().clone()).unwrap();
+//! let file_name_generator = DefaultFileNameGenerator::new(
+//! "test".to_string(),
+//! None,
+//! iceberg::spec::DataFileFormat::Parquet,
+//! );
+//!
+//! // Create a parquet file writer builder. The parameter can get from table.
+//! let parquet_writer_builder = ParquetWriterBuilder::new(
+//! WriterProperties::default(),
+//! table.metadata().current_schema().clone(),
+//! table.file_io().clone(),
+//! location_generator.clone(),
+//! file_name_generator.clone(),
+//! );
+//! // Create a data file writer builder using parquet file writer builder.
+//! let data_file_writer_builder = DataFileWriterBuilder::new(parquet_writer_builder, None);
+//! // Create latency record writer using data file writer builder.
+//! let latency_record_builder = LatencyRecordWriterBuilder::new(data_file_writer_builder);
+//! // Build the final writer
+//! let mut latency_record_data_file_writer = latency_record_builder.build().await.unwrap();
+//!
+//! Ok(())
+//! }
//! ```
</span><span class="kw">pub mod </span>base_writer;