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 fd41de01 deploy: 1097da71bb34af48f53a69c2138f7ec708e11703
fd41de01 is described below
commit fd41de019869f59bd3aa80e64c6e7061ccd7ce37
Author: liurenjie1024 <[email protected]>
AuthorDate: Mon Mar 3 02:06:40 2025 +0000
deploy: 1097da71bb34af48f53a69c2138f7ec708e11703
---
api/src/iceberg/arrow/schema.rs.html | 4 ++--
api/src/iceberg/avro/schema.rs.html | 18 +++++++++++-------
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/api/src/iceberg/arrow/schema.rs.html
b/api/src/iceberg/arrow/schema.rs.html
index 78d374f6..2c5e0e41 100644
--- a/api/src/iceberg/arrow/schema.rs.html
+++ b/api/src/iceberg/arrow/schema.rs.html
@@ -2203,11 +2203,11 @@
.with_timezone(<span class="string">"UTC"</span>),
))),
- (typ, <span class="kw">_</span>) => <span
class="prelude-val">Err</span>(Error::new(
+ (primitive_type, <span class="kw">_</span>) => <span
class="prelude-val">Err</span>(Error::new(
ErrorKind::FeatureUnsupported,
<span class="macro">format!</span>(
<span class="string">"Converting datum from type {:?} to arrow
not supported yet."</span>,
- typ
+ primitive_type
),
)),
}
diff --git a/api/src/iceberg/avro/schema.rs.html
b/api/src/iceberg/avro/schema.rs.html
index 8170910e..12509570 100644
--- a/api/src/iceberg/avro/schema.rs.html
+++ b/api/src/iceberg/avro/schema.rs.html
@@ -1211,6 +1211,8 @@
<a href="#1211" id="1211">1211</a>
<a href="#1212" id="1212">1212</a>
<a href="#1213" id="1213">1213</a>
+<a href="#1214" id="1214">1214</a>
+<a href="#1215" id="1215">1215</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
@@ -1655,13 +1657,14 @@
field_types: Vec<<span
class="prelude-ty">Option</span><Type>>,
) -> <span class="prelude-ty">Result</span><<span
class="prelude-ty">Option</span><Type>> {
<span class="kw">let </span><span class="kw-2">mut </span>fields =
Vec::with_capacity(field_types.len());
- <span class="kw">for </span>(avro_field, typ) <span class="kw">in
</span>record.fields.iter().zip_eq(field_types) {
+ <span class="kw">for </span>(avro_field, field_type) <span
class="kw">in </span>record.fields.iter().zip_eq(field_types) {
<span class="kw">let </span>field_id =
<span
class="self">Self</span>::get_element_id_from_attributes(<span
class="kw-2">&</span>avro_field.custom_attributes, FILED_ID_PROP)<span
class="question-mark">?</span>;
<span class="kw">let </span>optional = is_avro_optional(<span
class="kw-2">&</span>avro_field.schema);
- <span class="kw">let </span><span class="kw-2">mut </span>field =
NestedField::new(field_id, <span class="kw-2">&</span>avro_field.name,
typ.unwrap(), !optional);
+ <span class="kw">let </span><span class="kw-2">mut </span>field =
+ NestedField::new(field_id, <span
class="kw-2">&</span>avro_field.name, field_type.unwrap(), !optional);
<span class="kw">if let </span><span
class="prelude-val">Some</span>(doc) = <span
class="kw-2">&</span>avro_field.doc {
field = field.with_doc(doc);
@@ -1727,7 +1730,7 @@
}
<span class="kw">fn </span>primitive(<span class="kw-2">&mut
</span><span class="self">self</span>, schema: <span
class="kw-2">&</span>AvroSchema) -> <span
class="prelude-ty">Result</span><<span
class="prelude-ty">Option</span><Type>> {
- <span class="kw">let </span>typ = <span class="kw">match </span>schema
{
+ <span class="kw">let </span>schema_type = <span class="kw">match
</span>schema {
AvroSchema::Decimal(decimal) => {
Type::decimal(decimal.precision <span class="kw">as
</span>u32, decimal.scale <span class="kw">as </span>u32)<span
class="question-mark">?
</span>}
@@ -1774,7 +1777,7 @@
}
};
- <span class="prelude-val">Ok</span>(<span
class="prelude-val">Some</span>(typ))
+ <span class="prelude-val">Ok</span>(<span
class="prelude-val">Some</span>(schema_type))
}
<span class="kw">fn </span>map_array(
@@ -1823,15 +1826,16 @@
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span
class="kw">fn </span>avro_schema_to_schema(avro_schema: <span
class="kw-2">&</span>AvroSchema) -> <span
class="prelude-ty">Result</span><Schema> {
<span class="kw">if let </span>AvroSchema::Record(<span
class="kw">_</span>) = avro_schema {
<span class="kw">let </span><span class="kw-2">mut </span>converter =
AvroSchemaToSchema;
- <span class="kw">let </span>typ = visit(avro_schema, <span
class="kw-2">&mut </span>converter)<span
class="question-mark">?</span>.expect(<span class="string">"Iceberg schema
should not be none."</span>);
- <span class="kw">if let </span>Type::Struct(s) = typ {
+ <span class="kw">let </span>schema_type =
+ visit(avro_schema, <span class="kw-2">&mut
</span>converter)<span class="question-mark">?</span>.expect(<span
class="string">"Iceberg schema should not be none."</span>);
+ <span class="kw">if let </span>Type::Struct(s) = schema_type {
Schema::builder()
.with_fields(s.fields().iter().cloned())
.build()
} <span class="kw">else </span>{
<span class="prelude-val">Err</span>(Error::new(
ErrorKind::Unexpected,
- <span class="macro">format!</span>(<span
class="string">"Expected to convert avro record schema to struct type, but
{typ}"</span>),
+ <span class="macro">format!</span>(<span
class="string">"Expected to convert avro record schema to struct type, but
{schema_type}"</span>),
))
}
} <span class="kw">else </span>{