File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
datafusion/datasource/src Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -144,13 +144,10 @@ impl TableSchema {
144144 self . table_partition_cols = Arc :: new ( partition_cols) ;
145145 } else {
146146 // 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 ( ) ,
147+ let table_partition_cols = Arc :: get_mut ( & mut self . table_partition_cols ) . expect (
148+ "Expected to be the sole owner of table_partition_cols since this function accepts mut self" ,
153149 ) ;
150+ table_partition_cols. extend ( partition_cols) ;
154151 }
155152 let mut builder = SchemaBuilder :: from ( self . file_schema . as_ref ( ) ) ;
156153 builder. extend ( self . table_partition_cols . iter ( ) . cloned ( ) ) ;
You can’t perform that action at this time.
0 commit comments