()
| 800 | |
| 801 | #[test] |
| 802 | fn test_memory_order_eq() -> Result<()> { |
| 803 | let schema = Arc::new(Schema::new(vec![ |
| 804 | Field::new("a", DataType::Int64, false), |
| 805 | Field::new("b", DataType::Int64, false), |
| 806 | Field::new("c", DataType::Int64, false), |
| 807 | ])); |
| 808 | let sort1: LexOrdering = [ |
| 809 | PhysicalSortExpr { |
| 810 | expr: col("a", &schema)?, |
| 811 | options: SortOptions::default(), |
| 812 | }, |
| 813 | PhysicalSortExpr { |
| 814 | expr: col("b", &schema)?, |
| 815 | options: SortOptions::default(), |
| 816 | }, |
| 817 | ] |
| 818 | .into(); |
| 819 | let sort2: LexOrdering = [PhysicalSortExpr { |
| 820 | expr: col("c", &schema)?, |
| 821 | options: SortOptions::default(), |
| 822 | }] |
| 823 | .into(); |
| 824 | let mut expected_output_order = sort1.clone(); |
| 825 | expected_output_order.extend(sort2.clone()); |
| 826 | |
| 827 | let sort_information = vec![sort1.clone(), sort2.clone()]; |
| 828 | let mem_exec = DataSourceExec::from_data_source( |
| 829 | MemorySourceConfig::try_new(&[vec![]], schema, None)? |
| 830 | .try_with_sort_information(sort_information)?, |
| 831 | ); |
| 832 | |
| 833 | assert_eq!( |
| 834 | mem_exec.properties().output_ordering().unwrap(), |
| 835 | &expected_output_order |
| 836 | ); |
| 837 | let eq_properties = mem_exec.properties().equivalence_properties(); |
| 838 | assert!(eq_properties.oeq_class().contains(&sort1)); |
| 839 | assert!(eq_properties.oeq_class().contains(&sort2)); |
| 840 | Ok(()) |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | #[cfg(test)] |
nothing calls this directly
no test coverage detected
searching dependent graphs…