SubhamSinghal commented on code in PR #20370:
URL: https://github.com/apache/datafusion/pull/20370#discussion_r2868280317
##########
datafusion/datasource-parquet/src/file_format.rs:
##########
@@ -658,6 +670,22 @@ pub fn apply_file_schema_type_coercions(
})
.collect();
+ // Build field ID to field mapping if field IDs are enabled
+ let table_field_by_id: HashMap<i32, &Arc<Field>> = if enable_field_ids {
+ table_schema
+ .fields()
+ .iter()
+ .filter_map(|f| {
+ f.metadata()
+ .get(PARQUET_FIELD_ID_META_KEY)
+ .and_then(|id_str| id_str.parse::<i32>().ok())
+ .map(|id| (id, f))
+ })
+ .collect()
+ } else {
+ HashMap::new()
+ };
+
// Early return if no transformation needed
if !needs_view_transform && !needs_string_transform {
Review Comment:
@mbutrovich `needs_view_transform` and `needs_string_transform` flags are
set based on data types in table schema. Column names are not involved in flag
logic, they're only stored in HashMap for later lookup.
--
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]