Skip to content

Conversation

@nullccxsy
Copy link
Contributor

… MapType

- Implemented case-insensitive GetFieldByName in NestedType subclasses.
- Added lazy initialization for maps in StructType
- Handled duplicate names/IDs with Status returns instead of throws.

iceberg::SchemaField field2(5, "bar", iceberg::string(), true);
iceberg::Schema schema({field1, field2}, 100);
},
::testing::ThrowsMessage<std::runtime_error>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this gets removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for detecting duplicate IDs has been moved to GetFieldById. Didn’t we agree earlier that no exceptions would be thrown?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For list's element and map's key, value, do we need to do the same processing? However, I think it's a bit strange to handle it in GetFieldByName(), they are easy, so I didn't change its exception-throwing form.

Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. Left some nits.

@wgtmac
Copy link
Member

wgtmac commented Sep 1, 2025

BTW, the PR title is broken...

@nullccxsy nullccxsy changed the title feat: add case-insensitive field lookup for StructType, ListType, and… feat: add case-insensitive field lookup for NestedType Sep 1, 2025
@nullccxsy nullccxsy changed the title feat: add case-insensitive field lookup for NestedType feat: add find field (by id and name) support to NestedType Sep 1, 2025
@nullccxsy nullccxsy changed the title feat: add find field (by id and name) support to NestedType feat: add find field (by name) support to NestedType Sep 1, 2025
nullccxsy added 5 commits September 2, 2025 14:04
… MapType

    - Implemented case-insensitive GetFieldByName in NestedType subclasses.
    - Added lazy initialization for maps in StructType
    - Handled duplicate names/IDs with Status returns instead of throws.
- Streamlined the macro to reduce nesting and improve readability by using an inline if statement.
Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left some nits. Thanks for working on this!

@Fokko Fokko merged commit b80bf8d into apache:main Sep 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants