liurenjie1024 commented on code in PR #731:
URL: https://github.com/apache/iceberg-rust/pull/731#discussion_r1886072909


##########
crates/iceberg/src/arrow/value.rs:
##########
@@ -0,0 +1,1015 @@
+// 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
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use arrow_array::{
+    Array, BinaryArray, BooleanArray, Date32Array, Decimal128Array, 
Float32Array, Float64Array,
+    Int16Array, Int32Array, Int64Array, LargeBinaryArray, LargeStringArray, 
NullArray, StringArray,
+    StructArray, Time64MicrosecondArray, TimestampMicrosecondArray, 
TimestampNanosecondArray,
+};
+use arrow_schema::{DataType, TimeUnit};
+use itertools::Itertools;
+use parquet::arrow::PARQUET_FIELD_ID_META_KEY;
+
+use crate::spec::{Literal, PrimitiveType, Struct, StructType, Type};
+use crate::{Error, ErrorKind, Result};
+
+/// A post order arrow array visitor.
+/// # TODO
+/// - Add support for ListArray, MapArray

Review Comment:
   I can understand that we don't want to support `ListArray`, `MapArray` for 
now, but we should throw unsupport feature in implementation. As an interface, 
we should still take into account those types.



##########
crates/iceberg/src/arrow/value.rs:
##########
@@ -0,0 +1,1015 @@
+// 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
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use arrow_array::{
+    Array, BinaryArray, BooleanArray, Date32Array, Decimal128Array, 
Float32Array, Float64Array,
+    Int16Array, Int32Array, Int64Array, LargeBinaryArray, LargeStringArray, 
NullArray, StringArray,
+    StructArray, Time64MicrosecondArray, TimestampMicrosecondArray, 
TimestampNanosecondArray,
+};
+use arrow_schema::{DataType, TimeUnit};
+use itertools::Itertools;
+use parquet::arrow::PARQUET_FIELD_ID_META_KEY;
+
+use crate::spec::{Literal, PrimitiveType, Struct, StructType, Type};
+use crate::{Error, ErrorKind, Result};
+
+/// A post order arrow array visitor.
+/// # TODO
+/// - Add support for ListArray, MapArray
+trait ArrowArrayVistor {
+    type T;
+    fn null(&self, array: &NullArray, iceberg_type: &PrimitiveType) -> 
Result<Vec<Self::T>>;
+    fn boolean(&self, array: &BooleanArray, iceberg_type: &PrimitiveType) -> 
Result<Vec<Self::T>>;
+    fn int16(&self, array: &Int16Array, iceberg_type: &PrimitiveType) -> 
Result<Vec<Self::T>>;
+    fn int32(&self, array: &Int32Array, iceberg_type: &PrimitiveType) -> 
Result<Vec<Self::T>>;
+    fn int64(&self, array: &Int64Array, iceberg_type: &PrimitiveType) -> 
Result<Vec<Self::T>>;
+    fn float(&self, array: &Float32Array, iceberg_type: &PrimitiveType) -> 
Result<Vec<Self::T>>;
+    fn double(&self, array: &Float64Array, iceberg_type: &PrimitiveType) -> 
Result<Vec<Self::T>>;
+    fn decimal(

Review Comment:
   Should we consider condense these into to one method? Listing all primitive 
types seems too cumbersome to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to