We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc24dbd commit b981959Copy full SHA for b981959
1 file changed
datafusion/datasource/src/table_schema.rs
@@ -144,13 +144,10 @@ impl TableSchema {
144
self.table_partition_cols = Arc::new(partition_cols);
145
} else {
146
// Append to existing partition columns
147
- self.table_partition_cols = Arc::new(
148
- self.table_partition_cols
149
- .iter()
150
- .cloned()
151
- .chain(partition_cols)
152
- .collect(),
+ let table_partition_cols = Arc::get_mut(&mut self.table_partition_cols).expect(
+ "Expected to be the sole owner of table_partition_cols since this function accepts mut self",
153
);
+ table_partition_cols.extend(partition_cols);
154
}
155
let mut builder = SchemaBuilder::from(self.file_schema.as_ref());
156
builder.extend(self.table_partition_cols.iter().cloned());
0 commit comments