github-actions[bot] commented on code in PR #35398:
URL: https://github.com/apache/doris/pull/35398#discussion_r1615028256


##########
be/src/vec/exec/format/table/iceberg/partition_spec.cpp:
##########
@@ -0,0 +1,71 @@
+// 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.
+
+#include "vec/exec/format/table/iceberg/partition_spec.h"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "vec/exec/format/table/iceberg/schema.h"
+#include "vec/exec/format/table/iceberg/struct_like.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/partition_spec.cpp:69:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/schema.h:
##########
@@ -0,0 +1,55 @@
+// 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.
+
+#pragma once
+
+#include "vec/exec/format/table/iceberg/types.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/schema.h:53:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;

Review Comment:
   warning: annotate this function with 'override' or (rarely) 'final' 
[modernize-use-override]
   
   ```suggestion
       ~MapType() override = default;
   ```
   



##########
be/src/vec/exec/format/table/iceberg/partition_spec.h:
##########
@@ -0,0 +1,96 @@
+// 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.
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+#include <vector>
+
+namespace doris {
+namespace iceberg {
+
+class StructLike;
+class Schema;
+
+class PartitionField {
+public:
+    PartitionField(int sourceId, int fieldId, std::string name, std::string 
transform);
+
+    int source_id() const { return _source_id; }
+
+    int field_id() const { return _field_id; }
+
+    const std::string& name() const { return _name; }
+
+    const std::string& transform() const { return _transform; }
+
+private:
+    int _source_id;
+    int _field_id;
+    std::string _name;
+    std::string _transform;
+};
+
+class PartitionSpec {
+public:
+    class Builder {
+    public:
+        Builder(std::shared_ptr<Schema> schema);
+
+        ~Builder() = default;
+
+        Builder& with_spec_id(int new_spec_id);
+
+        Builder& add(int sourceId, int fieldId, std::string name, std::string 
transform);
+
+        Builder& add(int sourceId, std::string name, std::string transform);
+
+        std::unique_ptr<PartitionSpec> build();
+
+    private:
+        int next_field_id() { return ++_last_assigned_field_id; }
+
+    private:

Review Comment:
   warning: redundant access specifier has the same accessibility as the 
previous access specifier [readability-redundant-access-specifiers]
   
   ```suggestion
       
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/exec/format/table/iceberg/partition_spec.h:64:** previously 
declared here
   ```cpp
       private:
       ^
   ```
   
   </details>
   



##########
be/src/vec/exec/format/table/iceberg/partition_spec_parser.cpp:
##########
@@ -0,0 +1,67 @@
+// 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.
+
+#include "vec/exec/format/table/iceberg/partition_spec_parser.h"
+
+#include <rapidjson/error/en.h>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/partition_spec_parser.cpp:65:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/partition_spec.h:
##########
@@ -0,0 +1,96 @@
+// 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.
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+#include <vector>
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/partition_spec.h:94:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/partition_spec_parser.h:
##########
@@ -0,0 +1,56 @@
+// 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.
+
+#pragma once
+
+//#include <rapidjson/document.h>
+//#include <rapidjson/error/en.h>
+//
+//#include <unordered_set>
+//
+//#include "common/exception.h"
+//#include "vec/exec/format/table/iceberg/schema.h"
+#include <rapidjson/document.h>
+
+#include "vec/exec/format/table/iceberg/unbound_partition_spec.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/partition_spec_parser.h:54:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/schema.cpp:
##########
@@ -0,0 +1,53 @@
+// 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.
+
+#include "vec/exec/format/table/iceberg/schema.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/schema.cpp:51:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/partition_spec_parser.h:
##########
@@ -0,0 +1,56 @@
+// 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.
+
+#pragma once
+
+//#include <rapidjson/document.h>
+//#include <rapidjson/error/en.h>
+//
+//#include <unordered_set>
+//
+//#include "common/exception.h"
+//#include "vec/exec/format/table/iceberg/schema.h"
+#include <rapidjson/document.h>

Review Comment:
   warning: 'rapidjson/document.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <rapidjson/document.h>
            ^
   ```
   



##########
be/src/vec/exec/format/table/iceberg/struct_like.h:
##########
@@ -0,0 +1,37 @@
+// 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.
+
+#pragma once
+#include <any>
+
+#include "vec/exec/format/table/iceberg/types.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/struct_like.h:35:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/schema_parser.h:
##########
@@ -0,0 +1,68 @@
+// 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.
+
+#pragma once
+
+#include <rapidjson/document.h>

Review Comment:
   warning: 'rapidjson/document.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <rapidjson/document.h>
            ^
   ```
   



##########
be/src/vec/exec/format/table/iceberg/partition_spec.h:
##########
@@ -0,0 +1,96 @@
+// 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.
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+#include <vector>
+
+namespace doris {
+namespace iceberg {
+
+class StructLike;
+class Schema;
+
+class PartitionField {
+public:
+    PartitionField(int sourceId, int fieldId, std::string name, std::string 
transform);
+
+    int source_id() const { return _source_id; }
+
+    int field_id() const { return _field_id; }
+
+    const std::string& name() const { return _name; }
+
+    const std::string& transform() const { return _transform; }
+
+private:
+    int _source_id;
+    int _field_id;
+    std::string _name;
+    std::string _transform;
+};
+
+class PartitionSpec {
+public:
+    class Builder {
+    public:
+        Builder(std::shared_ptr<Schema> schema);
+
+        ~Builder() = default;
+
+        Builder& with_spec_id(int new_spec_id);
+
+        Builder& add(int sourceId, int fieldId, std::string name, std::string 
transform);
+
+        Builder& add(int sourceId, std::string name, std::string transform);
+
+        std::unique_ptr<PartitionSpec> build();
+
+    private:
+        int next_field_id() { return ++_last_assigned_field_id; }
+
+    private:
+        std::shared_ptr<Schema> _schema;
+        std::vector<PartitionField> _fields;
+        int _spec_id;
+        std::atomic<int> _last_assigned_field_id;
+    };
+
+    PartitionSpec(std::shared_ptr<Schema> schema, int spec_id, 
std::vector<PartitionField> fields,
+                  int last_assigned_field_id);
+
+    const Schema& schema() const { return *_schema; }
+
+    int spec_id() { return _spec_id; }

Review Comment:
   warning: method 'spec_id' can be made const 
[readability-make-member-function-const]
   
   ```suggestion
       int spec_id() const { return _spec_id; }
   ```
   



##########
be/src/vec/exec/format/table/iceberg/schema_parser.cpp:
##########
@@ -0,0 +1,163 @@
+// 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.
+
+#include "vec/exec/format/table/iceberg/schema_parser.h"
+
+#include <rapidjson/document.h>
+#include <rapidjson/error/en.h>
+
+#include <optional>
+#include <unordered_set>
+
+#include "vec/exec/format/table/iceberg/schema.h"
+#include "vec/exec/format/table/iceberg/types.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/schema_parser.cpp:161:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/types.h:397:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/schema_parser.h:
##########
@@ -0,0 +1,68 @@
+// 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.
+
+#pragma once
+
+#include <rapidjson/document.h>
+
+#include <memory>
+#include <unordered_set>
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/schema_parser.h:66:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       ~NestedType() override = default;
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.cpp:
##########
@@ -0,0 +1,188 @@
+// 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.
+
+#include "types.h"
+
+#include <optional>
+
+namespace doris {
+namespace iceberg {

Review Comment:
   warning: nested namespaces can be concatenated 
[modernize-concat-nested-namespaces]
   
   ```suggestion
   namespace doris::iceberg {
   ```
   
   be/src/vec/exec/format/table/iceberg/types.cpp:186:
   ```diff
   - } // namespace iceberg
   - } // namespace doris
   + } // namespace doris
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       ~PrimitiveType() override = default;
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;
+    static std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    static std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    Type* key_type() const;
+    Type* value_type() const;
+    int key_id() const;
+    int value_id() const;
+    bool is_value_required() const;
+    bool is_value_optional() const;
+    TypeID type_id() const override { return TypeID::MAP; }
+    bool is_map_type() override { return true; }
+
+    MapType* as_map_type() override { return this; }
+
+    virtual int field_count() const override { return 2; }

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       int field_count() const override { return 2; }
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;
+    static std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    static std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    Type* key_type() const;
+    Type* value_type() const;
+    int key_id() const;
+    int value_id() const;
+    bool is_value_required() const;
+    bool is_value_optional() const;
+    TypeID type_id() const override { return TypeID::MAP; }
+    bool is_map_type() override { return true; }
+
+    MapType* as_map_type() override { return this; }
+
+    virtual int field_count() const override { return 2; }
+
+    virtual Type* field_type(const std::string& field_name) override;
+
+    virtual const NestedField* field(int field_id) override;
+
+    std::string to_string() const override;
+
+private:
+    MapType(std::unique_ptr<NestedField> key_field, 
std::unique_ptr<NestedField> value_field)
+            : _key_field(std::move(key_field)), 
_value_field(std::move(value_field)) {}
+    friend std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    friend std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    std::unique_ptr<NestedField> _key_field;
+    std::unique_ptr<NestedField> _value_field;
+    std::vector<NestedField*> _fields;
+};
+
+class ListType : public NestedType {
+public:
+    ~ListType() = default;
+    static std::unique_ptr<ListType> of_optional(int element_id,
+                                                 std::unique_ptr<Type> 
element_type);
+    static std::unique_ptr<ListType> of_required(int element_id,
+                                                 std::unique_ptr<Type> 
element_type);
+
+    virtual TypeID type_id() const override { return TypeID::LIST; }
+
+    bool is_list_type() override { return true; }
+
+    ListType* as_list_type() override { return this; }
+
+    virtual std::string to_string() const override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       std::string to_string() const override;
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;
+    static std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    static std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    Type* key_type() const;
+    Type* value_type() const;
+    int key_id() const;
+    int value_id() const;
+    bool is_value_required() const;
+    bool is_value_optional() const;
+    TypeID type_id() const override { return TypeID::MAP; }
+    bool is_map_type() override { return true; }
+
+    MapType* as_map_type() override { return this; }
+
+    virtual int field_count() const override { return 2; }
+
+    virtual Type* field_type(const std::string& field_name) override;
+
+    virtual const NestedField* field(int field_id) override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       const NestedField* field(int field_id) override;
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;
+    static std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    static std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    Type* key_type() const;
+    Type* value_type() const;
+    int key_id() const;
+    int value_id() const;
+    bool is_value_required() const;
+    bool is_value_optional() const;
+    TypeID type_id() const override { return TypeID::MAP; }
+    bool is_map_type() override { return true; }
+
+    MapType* as_map_type() override { return this; }
+
+    virtual int field_count() const override { return 2; }
+
+    virtual Type* field_type(const std::string& field_name) override;

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       Type* field_type(const std::string& field_name) override;
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;
+    static std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    static std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    Type* key_type() const;
+    Type* value_type() const;
+    int key_id() const;
+    int value_id() const;
+    bool is_value_required() const;
+    bool is_value_optional() const;
+    TypeID type_id() const override { return TypeID::MAP; }
+    bool is_map_type() override { return true; }
+
+    MapType* as_map_type() override { return this; }
+
+    virtual int field_count() const override { return 2; }
+
+    virtual Type* field_type(const std::string& field_name) override;
+
+    virtual const NestedField* field(int field_id) override;
+
+    std::string to_string() const override;
+
+private:
+    MapType(std::unique_ptr<NestedField> key_field, 
std::unique_ptr<NestedField> value_field)
+            : _key_field(std::move(key_field)), 
_value_field(std::move(value_field)) {}
+    friend std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    friend std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    std::unique_ptr<NestedField> _key_field;
+    std::unique_ptr<NestedField> _value_field;
+    std::vector<NestedField*> _fields;
+};
+
+class ListType : public NestedType {
+public:
+    ~ListType() = default;

Review Comment:
   warning: annotate this function with 'override' or (rarely) 'final' 
[modernize-use-override]
   
   ```suggestion
       ~ListType() override = default;
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;
+    static std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    static std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    Type* key_type() const;
+    Type* value_type() const;
+    int key_id() const;
+    int value_id() const;
+    bool is_value_required() const;
+    bool is_value_optional() const;
+    TypeID type_id() const override { return TypeID::MAP; }
+    bool is_map_type() override { return true; }
+
+    MapType* as_map_type() override { return this; }
+
+    virtual int field_count() const override { return 2; }
+
+    virtual Type* field_type(const std::string& field_name) override;
+
+    virtual const NestedField* field(int field_id) override;
+
+    std::string to_string() const override;
+
+private:
+    MapType(std::unique_ptr<NestedField> key_field, 
std::unique_ptr<NestedField> value_field)
+            : _key_field(std::move(key_field)), 
_value_field(std::move(value_field)) {}
+    friend std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    friend std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    std::unique_ptr<NestedField> _key_field;
+    std::unique_ptr<NestedField> _value_field;
+    std::vector<NestedField*> _fields;
+};
+
+class ListType : public NestedType {
+public:
+    ~ListType() = default;
+    static std::unique_ptr<ListType> of_optional(int element_id,
+                                                 std::unique_ptr<Type> 
element_type);
+    static std::unique_ptr<ListType> of_required(int element_id,
+                                                 std::unique_ptr<Type> 
element_type);
+
+    virtual TypeID type_id() const override { return TypeID::LIST; }

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       TypeID type_id() const override { return TypeID::LIST; }
   ```
   



##########
be/src/vec/exec/format/table/iceberg/types.h:
##########
@@ -0,0 +1,399 @@
+// 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.
+
+#pragma once
+
+#include <iostream>
+#include <map>
+#include <optional>
+#include <regex>
+#include <stdexcept>
+#include <string>
+#include <vector>
+
+#include "common/exception.h"
+
+namespace doris {
+namespace iceberg {
+
+class PrimitiveType;
+class StructType;
+class ListType;
+class MapType;
+class NestedType;
+
+enum TypeID {
+    BOOLEAN,
+    INTEGER,
+    LONG,
+    FLOAT,
+    DOUBLE,
+    DATE,
+    TIME,
+    TIMESTAMP,
+    STRING,
+    UUID,
+    FIXED,
+    BINARY,
+    DECIMAL,
+    STRUCT,
+    LIST,
+    MAP
+};
+
+class Type {
+public:
+    virtual ~Type() = default;
+    virtual TypeID type_id() const = 0;
+    virtual bool is_primitive_type() { return false; }
+    virtual bool is_nested_type() { return false; }
+    virtual bool is_struct_type() { return false; }
+    virtual bool is_list_type() { return false; }
+    virtual bool is_map_type() { return false; }
+    virtual PrimitiveType* as_primitive_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a 
primitive type.");
+    }
+    virtual StructType* as_struct_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a struct 
type.");
+    }
+    virtual ListType* as_list_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a list 
type.");
+    }
+    virtual MapType* as_map_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a map 
type.");
+    }
+    virtual NestedType* as_nested_type() {
+        throw doris::Exception(doris::ErrorCode::INTERNAL_ERROR, "Not a nested 
type.");
+    }
+
+    virtual std::string to_string() const = 0;
+};
+
+class NestedField {
+public:
+    NestedField(bool optional, int field_id, std::string field_name,
+                std::unique_ptr<Type> field_type, std::optional<std::string> 
field_doc)
+            : _is_optional(optional),
+              _id(field_id),
+              _name(std::move(field_name)),
+              _type(std::move(field_type)),
+              _doc(std::move(field_doc)) {}
+
+    bool is_optional() const { return _is_optional; }
+
+    bool is_required() const { return !_is_optional; }
+
+    int field_id() const { return _id; }
+
+    const std::string& field_name() const { return _name; }
+
+    Type* field_type() const { return _type.get(); }
+
+    const std::optional<std::string>& field_doc() const { return _doc; }
+
+private:
+    bool _is_optional;
+    int _id;
+    std::string _name;
+    std::unique_ptr<Type> _type;
+    std::optional<std::string> _doc;
+};
+
+class NestedType : public Type {
+public:
+    virtual ~NestedType() override = default;
+
+    bool is_nested_type() override { return true; }
+    NestedType* as_nested_type() override { return this; }
+    virtual int field_count() const = 0;
+    virtual Type* field_type(const std::string& field_name) = 0;
+    virtual const NestedField* field(int field_id) = 0;
+};
+
+class PrimitiveType : public Type {
+public:
+    virtual ~PrimitiveType() override = default;
+    bool is_primitive_type() override { return true; }
+    PrimitiveType* as_primitive_type() override { return this; }
+};
+
+class MapType : public NestedType {
+public:
+    ~MapType() = default;
+    static std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    static std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    Type* key_type() const;
+    Type* value_type() const;
+    int key_id() const;
+    int value_id() const;
+    bool is_value_required() const;
+    bool is_value_optional() const;
+    TypeID type_id() const override { return TypeID::MAP; }
+    bool is_map_type() override { return true; }
+
+    MapType* as_map_type() override { return this; }
+
+    virtual int field_count() const override { return 2; }
+
+    virtual Type* field_type(const std::string& field_name) override;
+
+    virtual const NestedField* field(int field_id) override;
+
+    std::string to_string() const override;
+
+private:
+    MapType(std::unique_ptr<NestedField> key_field, 
std::unique_ptr<NestedField> value_field)
+            : _key_field(std::move(key_field)), 
_value_field(std::move(value_field)) {}
+    friend std::unique_ptr<MapType> of_optional(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+    friend std::unique_ptr<MapType> of_required(int key_id, int value_id,
+                                                std::unique_ptr<Type> key_type,
+                                                std::unique_ptr<Type> 
value_type);
+
+    std::unique_ptr<NestedField> _key_field;
+    std::unique_ptr<NestedField> _value_field;
+    std::vector<NestedField*> _fields;
+};
+
+class ListType : public NestedType {
+public:
+    ~ListType() = default;
+    static std::unique_ptr<ListType> of_optional(int element_id,
+                                                 std::unique_ptr<Type> 
element_type);
+    static std::unique_ptr<ListType> of_required(int element_id,
+                                                 std::unique_ptr<Type> 
element_type);
+
+    virtual TypeID type_id() const override { return TypeID::LIST; }
+
+    bool is_list_type() override { return true; }
+
+    ListType* as_list_type() override { return this; }
+
+    virtual std::string to_string() const override;
+
+    virtual int field_count() const override { return 1; }

Review Comment:
   warning: 'virtual' is redundant since the function is already declared 
'override' [modernize-use-override]
   
   ```suggestion
       int field_count() const override { return 1; }
   ```
   



-- 
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: commits-unsubscr...@doris.apache.org

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


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

Reply via email to