This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 00e3dc2c2d0 deploy: e8285bea0eca99316590fcefc8816e1df6581a5c
00e3dc2c2d0 is described below

commit 00e3dc2c2d0f041646279f5c341658d89b4a854e
Author: alamb <[email protected]>
AuthorDate: Thu Jun 13 20:12:30 2024 +0000

    deploy: e8285bea0eca99316590fcefc8816e1df6581a5c
---
 arrow_cast/cast/fn.cast_byte_to_view.html          |  2 +-
 arrow_cast/cast/fn.cast_view_to_byte.html          |  2 +-
 arrow_cast/cast/index.html                         |  2 +-
 parquet/arrow/buffer/offset_buffer/index.html      |  2 +-
 .../buffer/offset_buffer/struct.OffsetBuffer.html  |  4 +-
 .../record_reader/buffer/trait.ValuesBuffer.html   |  2 +-
 src/arrow_cast/cast/mod.rs.html                    | 62 +++++-----------------
 src/parquet/arrow/buffer/offset_buffer.rs.html     |  8 +--
 8 files changed, 25 insertions(+), 59 deletions(-)

diff --git a/arrow_cast/cast/fn.cast_byte_to_view.html 
b/arrow_cast/cast/fn.cast_byte_to_view.html
index 4650ab6a474..ddcb014b0e1 100644
--- a/arrow_cast/cast/fn.cast_byte_to_view.html
+++ b/arrow_cast/cast/fn.cast_byte_to_view.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="Helper 
function to cast from one `ByteArrayType` array to `ByteViewType` 
array."><title>cast_byte_to_view in arrow_cast::cast - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans
 [...]
+<!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="Helper 
function to cast from one `ByteArrayType` array to `ByteViewType` 
array."><title>cast_byte_to_view in arrow_cast::cast - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans
 [...]
     FROM: ByteArrayType,
     FROM::Offset: OffsetSizeTrait + <a class="trait" 
href="https://docs.rs/num-traits/0.2/num_traits/cast/trait.ToPrimitive.html"; 
title="trait num_traits::cast::ToPrimitive">ToPrimitive</a>,
     V: ByteViewType,</div></code></pre><details class="toggle top-doc" 
open><summary class="hideme"><span>Expand description</span></summary><div 
class="docblock"><p>Helper function to cast from one <code>ByteArrayType</code> 
array to <code>ByteViewType</code> array.</p>
diff --git a/arrow_cast/cast/fn.cast_view_to_byte.html 
b/arrow_cast/cast/fn.cast_view_to_byte.html
index b724bf0af6a..a60bcfe17bb 100644
--- a/arrow_cast/cast/fn.cast_view_to_byte.html
+++ b/arrow_cast/cast/fn.cast_view_to_byte.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="Helper 
function to cast from one `ByteViewType` array to `ByteArrayType` 
array."><title>cast_view_to_byte in arrow_cast::cast - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans
 [...]
+<!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="Helper 
function to cast from one `ByteViewType` array to `ByteArrayType` 
array."><title>cast_view_to_byte in arrow_cast::cast - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans
 [...]
     array: &amp;dyn Array,
 ) -&gt; <a class="enum" 
href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"; 
title="enum core::result::Result">Result</a>&lt;ArrayRef, ArrowError&gt;<div 
class="where">where
     FROM: ByteViewType,
diff --git a/arrow_cast/cast/index.html b/arrow_cast/cast/index.html
index dbe03b6ca79..1488a57167d 100644
--- a/arrow_cast/cast/index.html
+++ b/arrow_cast/cast/index.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="Cast 
kernels to convert `ArrayRef`  between supported 
datatypes."><title>arrow_cast::cast - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,Fira
 [...]
+<!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="Cast 
kernels to convert `ArrayRef`  between supported 
datatypes."><title>arrow_cast::cast - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,Fira
 [...]
 <p>See <a href="fn.cast_with_options.html" title="fn 
arrow_cast::cast::cast_with_options"><code>cast_with_options</code></a> for 
more information on specific conversions.</p>
 <p>Example:</p>
 
diff --git a/parquet/arrow/buffer/offset_buffer/index.html 
b/parquet/arrow/buffer/offset_buffer/index.html
index e6b18c72b9d..e19f5026b52 100644
--- a/parquet/arrow/buffer/offset_buffer/index.html
+++ b/parquet/arrow/buffer/offset_buffer/index.html
@@ -1,2 +1,2 @@
-<!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="API 
documentation for the Rust `offset_buffer` mod in crate 
`parquet`."><title>parquet::arrow::buffer::offset_buffer - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-
 [...]
+<!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="API 
documentation for the Rust `offset_buffer` mod in crate 
`parquet`."><title>parquet::arrow::buffer::offset_buffer - 
Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-
 [...]
 a corresponding 
[<code>ArrayRef</code>]</div></li></ul></section></div></main></body></html>
\ No newline at end of file
diff --git a/parquet/arrow/buffer/offset_buffer/struct.OffsetBuffer.html 
b/parquet/arrow/buffer/offset_buffer/struct.OffsetBuffer.html
index 10b006e8209..338f443523c 100644
--- a/parquet/arrow/buffer/offset_buffer/struct.OffsetBuffer.html
+++ b/parquet/arrow/buffer/offset_buffer/struct.OffsetBuffer.html
@@ -3,7 +3,7 @@
     pub values: <a class="struct" 
href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"; 
title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" 
href="https://doc.rust-lang.org/nightly/std/primitive.u8.html";>u8</a>&gt;,
 }</code></pre><details class="toggle top-doc" open><summary 
class="hideme"><span>Expand description</span></summary><div 
class="docblock"><p>A buffer of variable-sized byte arrays that can be 
converted into
 a corresponding [<code>ArrayRef</code>]</p>
-</div></details><h2 id="fields" class="fields section-header">Fields<a 
href="#fields" class="anchor">§</a></h2><span id="structfield.offsets" 
class="structfield section-header"><a href="#structfield.offsets" class="anchor 
field">§</a><code>offsets: <a class="struct" 
href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"; 
title="struct alloc::vec::Vec">Vec</a>&lt;I&gt;</code></span><span 
id="structfield.values" class="structfield section-header"><a 
href="#structfield.values" cl [...]
+</div></details><h2 id="fields" class="fields section-header">Fields<a 
href="#fields" class="anchor">§</a></h2><span id="structfield.offsets" 
class="structfield section-header"><a href="#structfield.offsets" class="anchor 
field">§</a><code>offsets: <a class="struct" 
href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"; 
title="struct alloc::vec::Vec">Vec</a>&lt;I&gt;</code></span><span 
id="structfield.values" class="structfield section-header"><a 
href="#structfield.values" cl [...]
 </div></details><section id="method.is_empty" class="method"><a class="src 
rightside" 
href="../../../../src/parquet/arrow/buffer/offset_buffer.rs.html#54-56">source</a><h4
 class="code-header">pub fn <a href="#method.is_empty" 
class="fn">is_empty</a>(&amp;self) -&gt; <a class="primitive" 
href="https://doc.rust-lang.org/nightly/std/primitive.bool.html";>bool</a></h4></section><details
 class="toggle method-toggle" open><summary><section id="method.try_push" 
class="method"><a class="src right [...]
 the start of a UTF-8 codepoint</p>
 <p>Note: This does not verify that the entirety of <code>data</code> is valid
@@ -28,7 +28,7 @@ sequence, but not the individual string slices it contains</p>
     null_buffer: <a class="enum" 
href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"; 
title="enum core::option::Option">Option</a>&lt;Buffer&gt;,
     data_type: ArrowType,
 ) -&gt; ArrayRef</h4></section></summary><div class="docblock"><p>Converts 
this into an [<code>ArrayRef</code>] with the provided <code>data_type</code> 
and <code>null_buffer</code></p>
-</div></details><section id="method.build_generic_byte_view" class="method"><a 
class="src rightside" 
href="../../../../src/parquet/arrow/buffer/offset_buffer.rs.html#157-175">source</a><h4
 class="code-header">fn <a href="#method.build_generic_byte_view" 
class="fn">build_generic_byte_view</a>(self) -&gt; 
GenericByteViewBuilder&lt;BinaryViewType&gt;</h4></section></div></details></div><h2
 id="trait-implementations" class="section-header">Trait Implementations<a 
href="#trait-implementations [...]
+</div></details><section id="method.build_generic_byte_view" class="method"><a 
class="src rightside" 
href="../../../../src/parquet/arrow/buffer/offset_buffer.rs.html#157-176">source</a><h4
 class="code-header">fn <a href="#method.build_generic_byte_view" 
class="fn">build_generic_byte_view</a>(self) -&gt; 
GenericByteViewBuilder&lt;BinaryViewType&gt;</h4></section></div></details></div><h2
 id="trait-implementations" class="section-header">Trait Implementations<a 
href="#trait-implementations [...]
     &amp;mut self,
     read_offset: <a class="primitive" 
href="https://doc.rust-lang.org/nightly/std/primitive.usize.html";>usize</a>,
     values_read: <a class="primitive" 
href="https://doc.rust-lang.org/nightly/std/primitive.usize.html";>usize</a>,
diff --git a/parquet/arrow/record_reader/buffer/trait.ValuesBuffer.html 
b/parquet/arrow/record_reader/buffer/trait.ValuesBuffer.html
index fbca832a278..2f7eedb02b0 100644
--- a/parquet/arrow/record_reader/buffer/trait.ValuesBuffer.html
+++ b/parquet/arrow/record_reader/buffer/trait.ValuesBuffer.html
@@ -32,4 +32,4 @@ the non-null level positions. This is what this method 
does.</p>
     values_read: <a class="primitive" 
href="https://doc.rust-lang.org/nightly/std/primitive.usize.html";>usize</a>,
     levels_read: <a class="primitive" 
href="https://doc.rust-lang.org/nightly/std/primitive.usize.html";>usize</a>,
     valid_mask: &amp;[<a class="primitive" 
href="https://doc.rust-lang.org/nightly/std/primitive.u8.html";>u8</a>],
-)</h4></section></div></details><h2 id="implementors" 
class="section-header">Implementors<a href="#implementors" 
class="anchor">§</a></h2><div id="implementors-list"><section 
id="impl-ValuesBuffer-for-OffsetBuffer%3CI%3E" class="impl"><a class="src 
rightside" 
href="../../../../src/parquet/arrow/buffer/offset_buffer.rs.html#178-226">source</a><a
 href="#impl-ValuesBuffer-for-OffsetBuffer%3CI%3E" class="anchor">§</a><h3 
class="code-header">impl&lt;I: OffsetSizeTrait&gt; <a class="trait" hre [...]
\ No newline at end of file
+)</h4></section></div></details><h2 id="implementors" 
class="section-header">Implementors<a href="#implementors" 
class="anchor">§</a></h2><div id="implementors-list"><section 
id="impl-ValuesBuffer-for-OffsetBuffer%3CI%3E" class="impl"><a class="src 
rightside" 
href="../../../../src/parquet/arrow/buffer/offset_buffer.rs.html#179-227">source</a><a
 href="#impl-ValuesBuffer-for-OffsetBuffer%3CI%3E" class="anchor">§</a><h3 
class="code-header">impl&lt;I: OffsetSizeTrait&gt; <a class="trait" hre [...]
\ No newline at end of file
diff --git a/src/arrow_cast/cast/mod.rs.html b/src/arrow_cast/cast/mod.rs.html
index 2669b0592f6..3f13251ce6d 100644
--- a/src/arrow_cast/cast/mod.rs.html
+++ b/src/arrow_cast/cast/mod.rs.html
@@ -9110,24 +9110,6 @@
 <a href="#9110" id="9110">9110</a>
 <a href="#9111" id="9111">9111</a>
 <a href="#9112" id="9112">9112</a>
-<a href="#9113" id="9113">9113</a>
-<a href="#9114" id="9114">9114</a>
-<a href="#9115" id="9115">9115</a>
-<a href="#9116" id="9116">9116</a>
-<a href="#9117" id="9117">9117</a>
-<a href="#9118" id="9118">9118</a>
-<a href="#9119" id="9119">9119</a>
-<a href="#9120" id="9120">9120</a>
-<a href="#9121" id="9121">9121</a>
-<a href="#9122" id="9122">9122</a>
-<a href="#9123" id="9123">9123</a>
-<a href="#9124" id="9124">9124</a>
-<a href="#9125" id="9125">9125</a>
-<a href="#9126" id="9126">9126</a>
-<a href="#9127" id="9127">9127</a>
-<a href="#9128" id="9128">9128</a>
-<a href="#9129" id="9129">9129</a>
-<a href="#9130" id="9130">9130</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
@@ -9176,7 +9158,7 @@
 <span class="kw">use </span><span class="kw">crate</span>::cast::list::<span 
class="kw-2">*</span>;
 <span class="kw">use </span><span class="kw">crate</span>::cast::string::<span 
class="kw-2">*</span>;
 
-<span class="kw">use </span>arrow_buffer::{IntervalMonthDayNano, ScalarBuffer};
+<span class="kw">use </span>arrow_buffer::IntervalMonthDayNano;
 <span class="kw">use </span>arrow_data::ByteView;
 <span class="kw">use </span>chrono::{NaiveTime, Offset, TimeZone, Utc};
 <span class="kw">use </span>std::cmp::Ordering;
@@ -11471,47 +11453,29 @@
     FROM::Offset: OffsetSizeTrait + ToPrimitive,
     V: ByteViewType,
 {
-    <span class="kw">let </span>data = array.to_data();
-    <span class="macro">assert_eq!</span>(data.data_type(), <span 
class="kw-2">&amp;</span>FROM::DATA_TYPE);
-
+    <span class="kw">let </span>byte_array: <span 
class="kw-2">&amp;</span>GenericByteArray&lt;FROM&gt; = array.as_bytes();
     <span class="kw">let </span>len = array.len();
-    <span class="kw">let </span>str_values_buf = data.buffers()[<span 
class="number">1</span>].clone();
-    <span class="kw">let </span>offsets = data.buffers()[<span 
class="number">0</span>].typed_data::&lt;FROM::Offset&gt;();
+    <span class="kw">let </span>str_values_buf = byte_array.values().clone();
+    <span class="kw">let </span>offsets = byte_array.offsets();
 
-    <span class="kw">let </span><span class="kw-2">mut </span>views_builder = 
BufferBuilder::&lt;u128&gt;::new(len);
-    <span class="kw">for </span>w <span class="kw">in 
</span>offsets.windows(<span class="number">2</span>) {
+    <span class="kw">let </span><span class="kw-2">mut </span>views_builder = 
GenericByteViewBuilder::&lt;V&gt;::with_capacity(len);
+    <span class="kw">let </span>block = 
views_builder.append_block(str_values_buf);
+    <span class="kw">for </span>(i, w) <span class="kw">in 
</span>offsets.windows(<span class="number">2</span>).enumerate() {
         <span class="kw">let </span>offset = w[<span 
class="number">0</span>].to_u32().unwrap();
         <span class="kw">let </span>end = w[<span 
class="number">1</span>].to_u32().unwrap();
-        <span class="kw">let </span>value_buf = <span 
class="kw-2">&amp;</span>str_values_buf[offset <span class="kw">as 
</span>usize..end <span class="kw">as </span>usize];
         <span class="kw">let </span>length = end - offset;
 
-        <span class="kw">if </span>length &lt;= <span class="number">12 
</span>{
-            <span class="kw">let </span><span class="kw-2">mut 
</span>view_buffer = [<span class="number">0</span>; <span 
class="number">16</span>];
-            view_buffer[<span class="number">0</span>..<span 
class="number">4</span>].copy_from_slice(<span 
class="kw-2">&amp;</span>length.to_le_bytes());
-            view_buffer[<span class="number">4</span>..<span class="number">4 
</span>+ value_buf.len()].copy_from_slice(value_buf);
-            views_builder.append(u128::from_le_bytes(view_buffer));
+        <span class="kw">if </span>byte_array.is_null(i) {
+            views_builder.append_null();
         } <span class="kw">else </span>{
-            <span class="kw">let </span>view = ByteView {
-                length,
-                prefix: u32::from_le_bytes(value_buf[<span 
class="number">0</span>..<span class="number">4</span>].try_into().unwrap()),
-                buffer_index: <span class="number">0</span>,
-                offset,
-            };
-            views_builder.append(view.into());
+            <span class="comment">// Safety: the input was a valid array so it 
valid UTF8 (if string). And
+            // all offsets were valid and we created the views correctly
+            </span><span class="kw">unsafe </span>{ 
views_builder.append_view_unchecked(block, offset, length) }
         }
     }
 
     <span class="macro">assert_eq!</span>(views_builder.len(), len);
-
-    <span class="comment">// Safety: the input was a valid array so it valid 
UTF8 (if string). And
-    // all offsets were valid and we created the views correctly
-    </span><span class="prelude-val">Ok</span>(Arc::new(<span 
class="kw">unsafe </span>{
-        GenericByteViewArray::&lt;V&gt;::new_unchecked(
-            ScalarBuffer::new(views_builder.finish(), <span 
class="number">0</span>, len),
-            <span class="macro">vec!</span>[str_values_buf],
-            data.nulls().cloned(),
-        )
-    }))
+    <span class="prelude-val">Ok</span>(Arc::new(views_builder.finish()))
 }
 
 <span class="doccomment">/// Helper function to cast from one `ByteViewType` 
array to `ByteArrayType` array.
diff --git a/src/parquet/arrow/buffer/offset_buffer.rs.html 
b/src/parquet/arrow/buffer/offset_buffer.rs.html
index 463c7f331a6..16d31060854 100644
--- a/src/parquet/arrow/buffer/offset_buffer.rs.html
+++ b/src/parquet/arrow/buffer/offset_buffer.rs.html
@@ -406,6 +406,7 @@
 <a href="#406" id="406">406</a>
 <a href="#407" id="407">407</a>
 <a href="#408" id="408">408</a>
+<a href="#409" id="409">409</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
@@ -572,9 +573,10 @@
             <span class="kw">let </span>len = (end - 
start).to_usize().unwrap();
 
             <span class="kw">if </span>len != <span class="number">0 </span>{
-                builder
-                    .try_append_view(block, start.as_usize() <span 
class="kw">as </span>u32, len <span class="kw">as </span>u32)
-                    .unwrap();
+                <span class="comment">// Safety: (1) the buffer is valid (2) 
the offsets are valid (3) the values in between are of ByteViewType
+                </span><span class="kw">unsafe </span>{
+                    builder.append_view_unchecked(block, start.as_usize() 
<span class="kw">as </span>u32, len <span class="kw">as </span>u32);
+                }
             } <span class="kw">else </span>{
                 builder.append_null();
             }

Reply via email to