@@ -410,81 +410,3 @@ use datafusion_execution::TaskContext;
410
410
pub use datafusion_physical_expr:: {
411
411
expressions, functions, hash_utils, ordering_equivalence_properties_helper, udf,
412
412
} ;
413
-
414
- #[ cfg( test) ]
415
- mod tests {
416
- use super :: * ;
417
- use arrow:: datatypes:: DataType ;
418
- use arrow:: datatypes:: Schema ;
419
-
420
- use crate :: physical_plan:: Distribution ;
421
- use crate :: physical_plan:: Partitioning ;
422
- use crate :: physical_plan:: PhysicalExpr ;
423
- use datafusion_physical_expr:: expressions:: Column ;
424
-
425
- use std:: sync:: Arc ;
426
-
427
- #[ tokio:: test]
428
- async fn partitioning_satisfy_distribution ( ) -> Result < ( ) > {
429
- let schema = Arc :: new ( Schema :: new ( vec ! [
430
- arrow:: datatypes:: Field :: new( "column_1" , DataType :: Int64 , false ) ,
431
- arrow:: datatypes:: Field :: new( "column_2" , DataType :: Utf8 , false ) ,
432
- ] ) ) ;
433
-
434
- let partition_exprs1: Vec < Arc < dyn PhysicalExpr > > = vec ! [
435
- Arc :: new( Column :: new_with_schema( "column_1" , & schema) . unwrap( ) ) ,
436
- Arc :: new( Column :: new_with_schema( "column_2" , & schema) . unwrap( ) ) ,
437
- ] ;
438
-
439
- let partition_exprs2: Vec < Arc < dyn PhysicalExpr > > = vec ! [
440
- Arc :: new( Column :: new_with_schema( "column_2" , & schema) . unwrap( ) ) ,
441
- Arc :: new( Column :: new_with_schema( "column_1" , & schema) . unwrap( ) ) ,
442
- ] ;
443
-
444
- let distribution_types = vec ! [
445
- Distribution :: UnspecifiedDistribution ,
446
- Distribution :: SinglePartition ,
447
- Distribution :: HashPartitioned ( partition_exprs1. clone( ) ) ,
448
- ] ;
449
-
450
- let single_partition = Partitioning :: UnknownPartitioning ( 1 ) ;
451
- let unspecified_partition = Partitioning :: UnknownPartitioning ( 10 ) ;
452
- let round_robin_partition = Partitioning :: RoundRobinBatch ( 10 ) ;
453
- let hash_partition1 = Partitioning :: Hash ( partition_exprs1, 10 ) ;
454
- let hash_partition2 = Partitioning :: Hash ( partition_exprs2, 10 ) ;
455
-
456
- for distribution in distribution_types {
457
- let result = (
458
- single_partition. satisfy ( distribution. clone ( ) , || {
459
- EquivalenceProperties :: new ( schema. clone ( ) )
460
- } ) ,
461
- unspecified_partition. satisfy ( distribution. clone ( ) , || {
462
- EquivalenceProperties :: new ( schema. clone ( ) )
463
- } ) ,
464
- round_robin_partition. satisfy ( distribution. clone ( ) , || {
465
- EquivalenceProperties :: new ( schema. clone ( ) )
466
- } ) ,
467
- hash_partition1. satisfy ( distribution. clone ( ) , || {
468
- EquivalenceProperties :: new ( schema. clone ( ) )
469
- } ) ,
470
- hash_partition2. satisfy ( distribution. clone ( ) , || {
471
- EquivalenceProperties :: new ( schema. clone ( ) )
472
- } ) ,
473
- ) ;
474
-
475
- match distribution {
476
- Distribution :: UnspecifiedDistribution => {
477
- assert_eq ! ( result, ( true , true , true , true , true ) )
478
- }
479
- Distribution :: SinglePartition => {
480
- assert_eq ! ( result, ( true , false , false , false , false ) )
481
- }
482
- Distribution :: HashPartitioned ( _) => {
483
- assert_eq ! ( result, ( false , false , false , true , false ) )
484
- }
485
- }
486
- }
487
-
488
- Ok ( ( ) )
489
- }
490
- }
0 commit comments