File tree 1 file changed +4
-28
lines changed
datafusion/core/src/datasource/physical_plan/parquet 1 file changed +4
-28
lines changed Original file line number Diff line number Diff line change @@ -303,24 +303,12 @@ macro_rules! get_statistics {
303
303
) ) ) ,
304
304
DataType :: Int8 => Ok ( Arc :: new( Int8Array :: from_iter(
305
305
[ <$stat_type_prefix Int32StatsIterator >] :: new( $iterator) . map( |x| {
306
- x. and_then( |x| {
307
- if let Ok ( v) = i8 :: try_from( * x) {
308
- Some ( v)
309
- } else {
310
- None
311
- }
312
- } )
306
+ x. and_then( |x| i8 :: try_from( * x) . ok( ) )
313
307
} ) ,
314
308
) ) ) ,
315
309
DataType :: Int16 => Ok ( Arc :: new( Int16Array :: from_iter(
316
310
[ <$stat_type_prefix Int32StatsIterator >] :: new( $iterator) . map( |x| {
317
- x. and_then( |x| {
318
- if let Ok ( v) = i16 :: try_from( * x) {
319
- Some ( v)
320
- } else {
321
- None
322
- }
323
- } )
311
+ x. and_then( |x| i16 :: try_from( * x) . ok( ) )
324
312
} ) ,
325
313
) ) ) ,
326
314
DataType :: Int32 => Ok ( Arc :: new( Int32Array :: from_iter(
@@ -331,24 +319,12 @@ macro_rules! get_statistics {
331
319
) ) ) ,
332
320
DataType :: UInt8 => Ok ( Arc :: new( UInt8Array :: from_iter(
333
321
[ <$stat_type_prefix Int32StatsIterator >] :: new( $iterator) . map( |x| {
334
- x. and_then( |x| {
335
- if let Ok ( v) = u8 :: try_from( * x) {
336
- Some ( v)
337
- } else {
338
- None
339
- }
340
- } )
322
+ x. and_then( |x| u8 :: try_from( * x) . ok( ) )
341
323
} ) ,
342
324
) ) ) ,
343
325
DataType :: UInt16 => Ok ( Arc :: new( UInt16Array :: from_iter(
344
326
[ <$stat_type_prefix Int32StatsIterator >] :: new( $iterator) . map( |x| {
345
- x. and_then( |x| {
346
- if let Ok ( v) = u16 :: try_from( * x) {
347
- Some ( v)
348
- } else {
349
- None
350
- }
351
- } )
327
+ x. and_then( |x| u16 :: try_from( * x) . ok( ) )
352
328
} ) ,
353
329
) ) ) ,
354
330
DataType :: UInt32 => Ok ( Arc :: new( UInt32Array :: from_iter(
You can’t perform that action at this time.
0 commit comments