Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Jun 24, 2024
1 parent 708042d commit 33220d9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,7 @@ impl ProjectionPushDown {
&file_info.schema,
scan_type.sort_projection(&file_options),
)?;
// Hive partitions are created AFTER the projection, so the output
// schema is incorrect. Here we ensure the columns that are projected and hive
// parts are added at the proper place in the schema, which is at the end.

hive_parts = if let Some(hive_parts) = hive_parts {
let (new_schema, projected_indices) = hive_parts[0]
.get_projection_schema_and_indices(with_columns.as_ref());
Expand All @@ -453,6 +451,9 @@ impl ProjectionPushDown {
hive_parts
};

// Hive partitions are created AFTER the projection, so the output
// schema is incorrect. Here we ensure the columns that are projected and hive
// parts are added at the proper place in the schema, which is at the end.
if let Some(ref mut hive_parts) = hive_parts {
let partition_schema = hive_parts.first().unwrap().schema();

Expand Down

0 comments on commit 33220d9

Please sign in to comment.