File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
datafusion/core/src/dataframe Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ use super::{
28
28
use datafusion_common:: config:: TableParquetOptions ;
29
29
use datafusion_expr:: dml:: InsertOp ;
30
30
31
+ use crate :: error:: Result ;
32
+ use arrow:: datatypes:: { DataType , Field , Schema } ;
31
33
impl DataFrame {
32
34
/// Execute the `DataFrame` and write the results to Parquet file(s).
33
35
///
@@ -76,25 +78,24 @@ impl DataFrame {
76
78
77
79
// Ensure that the schema is preserved during serialization
78
80
let schema = self . plan . schema ( ) ;
79
- let fields: Vec < Field > = schema
81
+ let fields: Vec < Arc < Field > > = schema
80
82
. fields ( )
81
83
. iter ( )
82
84
. map ( |field| {
83
85
if let DataType :: FixedSizeList ( _, size) = field. data_type ( ) {
84
- Field :: new (
86
+ Arc :: new ( Field :: new (
85
87
field. name ( ) ,
86
88
DataType :: FixedSizeList (
87
- Box :: new ( Field :: new ( "item" , DataType :: Float32 , true ) ) ,
89
+ Arc :: new ( Field :: new ( "item" , DataType :: Float32 , true ) ) ,
88
90
* size,
89
91
) ,
90
92
field. is_nullable ( ) ,
91
- )
93
+ ) )
92
94
} else {
93
95
field. clone ( )
94
96
}
95
97
} )
96
98
. collect ( ) ;
97
- let schema = Arc :: new ( Schema :: new ( fields) ) ;
98
99
99
100
let plan = LogicalPlanBuilder :: copy_to (
100
101
self . plan ,
You can’t perform that action at this time.
0 commit comments