sdd commented on code in PR #317: URL: https://github.com/apache/iceberg-rust/pull/317#discussion_r1554171392
########## crates/iceberg/src/expr/accessor.rs: ########## @@ -0,0 +1,114 @@ +// 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 crate::spec::{Literal, Struct, Type}; +use serde_derive::{Deserialize, Serialize}; +use std::sync::Arc; + +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] +enum InnerOrType { + Inner(Arc<StructAccessor>), + Type(Type), +} + +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] +pub struct StructAccessor { Review Comment: This was deliberate - in the Java implementation, `Accessor` is an interface and generic over `T`, with T usually being `StructLike`, and `StructLike` is itself an interface. Since we only have `Struct` at the moment , rather than several structs that implement a `StructLike` trait, I went for `StructAccessor`, since ours is closer to `Accessor<Struct>` in the Java implementation, and this allows us to implement a more generic `Accessor` at some point in the future alongside `StructAccessor`. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
