1313
1414use std:: sync:: Arc ;
1515
16- use datafusion :: arrow:: array:: { ArrayRef , Float64Array , Int64Array , StringArray } ;
17- use datafusion :: arrow:: datatypes:: { DataType , Field , Schema , SchemaRef } ;
18- use datafusion :: arrow:: record_batch:: RecordBatch ;
16+ use arrow:: array:: { ArrayRef , Float64Array , Int64Array , StringArray } ;
17+ use arrow:: datatypes:: { DataType , Field , Schema , SchemaRef } ;
18+ use arrow:: record_batch:: RecordBatch ;
1919
2020/// Convert a JSON array of document rows into an Arrow RecordBatch.
2121///
@@ -163,9 +163,9 @@ pub fn arrow_sum(batch: &RecordBatch, column_name: &str) -> Option<f64> {
163163 let array = batch. column ( idx) ;
164164
165165 if let Some ( f64_arr) = array. as_any ( ) . downcast_ref :: < Float64Array > ( ) {
166- Some ( datafusion :: arrow:: compute:: kernels:: aggregate:: sum ( f64_arr) . unwrap_or ( 0.0 ) )
166+ Some ( arrow:: compute:: kernels:: aggregate:: sum ( f64_arr) . unwrap_or ( 0.0 ) )
167167 } else if let Some ( i64_arr) = array. as_any ( ) . downcast_ref :: < Int64Array > ( ) {
168- let sum = datafusion :: arrow:: compute:: kernels:: aggregate:: sum ( i64_arr) . unwrap_or ( 0 ) ;
168+ let sum = arrow:: compute:: kernels:: aggregate:: sum ( i64_arr) . unwrap_or ( 0 ) ;
169169 Some ( sum as f64 )
170170 } else {
171171 None
@@ -178,9 +178,9 @@ pub fn arrow_min(batch: &RecordBatch, column_name: &str) -> Option<f64> {
178178 let array = batch. column ( idx) ;
179179
180180 if let Some ( f64_arr) = array. as_any ( ) . downcast_ref :: < Float64Array > ( ) {
181- datafusion :: arrow:: compute:: kernels:: aggregate:: min ( f64_arr)
181+ arrow:: compute:: kernels:: aggregate:: min ( f64_arr)
182182 } else if let Some ( i64_arr) = array. as_any ( ) . downcast_ref :: < Int64Array > ( ) {
183- datafusion :: arrow:: compute:: kernels:: aggregate:: min ( i64_arr) . map ( |v| v as f64 )
183+ arrow:: compute:: kernels:: aggregate:: min ( i64_arr) . map ( |v| v as f64 )
184184 } else {
185185 None
186186 }
@@ -192,9 +192,9 @@ pub fn arrow_max(batch: &RecordBatch, column_name: &str) -> Option<f64> {
192192 let array = batch. column ( idx) ;
193193
194194 if let Some ( f64_arr) = array. as_any ( ) . downcast_ref :: < Float64Array > ( ) {
195- datafusion :: arrow:: compute:: kernels:: aggregate:: max ( f64_arr)
195+ arrow:: compute:: kernels:: aggregate:: max ( f64_arr)
196196 } else if let Some ( i64_arr) = array. as_any ( ) . downcast_ref :: < Int64Array > ( ) {
197- datafusion :: arrow:: compute:: kernels:: aggregate:: max ( i64_arr) . map ( |v| v as f64 )
197+ arrow:: compute:: kernels:: aggregate:: max ( i64_arr) . map ( |v| v as f64 )
198198 } else {
199199 None
200200 }
@@ -223,7 +223,7 @@ pub fn arrow_avg(batch: &RecordBatch, column_name: &str) -> Option<f64> {
223223/// Used by the Control Plane to receive Arrow data from the Data Plane
224224/// across the SPSC bridge.
225225pub fn decode_arrow_ipc ( bytes : & [ u8 ] ) -> Option < RecordBatch > {
226- use datafusion :: arrow:: ipc:: reader:: StreamReader ;
226+ use arrow:: ipc:: reader:: StreamReader ;
227227 let cursor = std:: io:: Cursor :: new ( bytes) ;
228228 let mut reader = StreamReader :: try_new ( cursor, None ) . ok ( ) ?;
229229 reader. next ( ) ?. ok ( )
0 commit comments