-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Recurse into MAP
and LIST
with the remap_struct
and the MFR ColumnMapper
#17448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Follow up adding support for altering structs inside lists/maps is here: https://github.com/Tishj/duckdb/tree/list_alter_type |
@@ -301,12 +452,16 @@ ColumnMapResult MapColumn(ClientContext &context, const MultiFileColumnDefinitio | |||
// found a column mapping for this child - emplace it | |||
column_mapping.emplace_back(global_child.name, std::move(child_map.column_map)); | |||
} | |||
//! FIXME: the 'default_value' should only be used if the STRUCT's default value is not NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this merges I'll work on adding support for the initial-default
to iceberg and build a test for the table of point
point.x
and point.y
from here: https://iceberg.apache.org/spec/#default-values while likely making changes to core here to support these scenarios.
Thanks! |
Recurse into `MAP` and `LIST` with the `remap_struct` and the MFR ColumnMapper (duckdb/duckdb#17448)
Recurse into `MAP` and `LIST` with the `remap_struct` and the MFR ColumnMapper (duckdb/duckdb#17448)
Recurse into `MAP` and `LIST` with the `remap_struct` and the MFR ColumnMapper (duckdb/duckdb#17448)
) Follow-up fixes from #17448 Nested default values were ignored, which caused this code not to correctly handle missing fields. In addition, we can no longer directly emit the default value as the result since the default value is no longer equivalent to the actual value (e.g. the default value might be `{'list': {'k': NULL}}` when the actual value should be `[{'k': NULL}]`.) We fix this by allowing `remap_struct` to take `NULL` as remap target, in case there are zero columns used from the source struct.
This PR solves the issue that we don't traverse into LIST and MAP in the MultiFileReader, so schema evolutions to a STRUCT inside a LIST/MAP currently don't get applied properly.
Fixes https://github.com/duckdblabs/duckdb-internal/issues/4846
Now we properly traverse these types just like we already do for STRUCT.