File tree Expand file tree Collapse file tree 3 files changed +27
-19
lines changed
cubestore/src/queryplanner Expand file tree Collapse file tree 3 files changed +27
-19
lines changed Original file line number Diff line number Diff line change @@ -8647,12 +8647,12 @@ async fn limit_pushdown_unique_key(service: Box<dyn SqlClient>) {
86478647 //===========================
86488648 let res = assert_limit_pushdown (
86498649 & service,
8650- "SELECT a, b, SUM(c) FROM (
8650+ "SELECT a FROM (SELECT a , b, SUM(c) FROM (
86518651 SELECT * FROM foo.pushdown_where_group1
86528652 union all
86538653 SELECT * FROM foo.pushdown_where_group2
86548654 ) as `tb`
8655- GROUP BY 1, 2 ORDER BY 1 LIMIT 3" ,
8655+ GROUP BY 1, 2 ORDER BY 1 LIMIT 3) x " ,
86568656 Some ( "ind1" ) ,
86578657 true ,
86588658 false ,
@@ -8665,18 +8665,18 @@ async fn limit_pushdown_unique_key(service: Box<dyn SqlClient>) {
86658665 vec![
86668666 Row :: new( vec![
86678667 TableValue :: Int ( 11 ) ,
8668- TableValue :: Int ( 18 ) ,
8669- TableValue :: Int ( 3 )
8668+ // TableValue::Int(18),
8669+ // TableValue::Int(3)
86708670 ] ) ,
86718671 Row :: new( vec![
86728672 TableValue :: Int ( 11 ) ,
8673- TableValue :: Int ( 45 ) ,
8674- TableValue :: Int ( 1 )
8673+ // TableValue::Int(45),
8674+ // TableValue::Int(1)
86758675 ] ) ,
86768676 Row :: new( vec![
86778677 TableValue :: Int ( 12 ) ,
8678- TableValue :: Int ( 20 ) ,
8679- TableValue :: Int ( 4 )
8678+ // TableValue::Int(20),
8679+ // TableValue::Int(4)
86808680 ] ) ,
86818681 ]
86828682 ) ;
Original file line number Diff line number Diff line change @@ -41,15 +41,11 @@ impl LastRowByUniqueKeyExec {
4141 "Empty unique_key passed for LastRowByUniqueKeyExec" . to_string ( ) ,
4242 ) ) ;
4343 }
44- let schema = input. schema ( ) ;
44+ let properties = input. properties ( ) . clone ( ) ;
4545 Ok ( Self {
4646 input,
4747 unique_key,
48- properties : PlanProperties :: new (
49- EquivalenceProperties :: new ( schema) ,
50- Partitioning :: UnknownPartitioning ( 1 ) ,
51- ExecutionMode :: Bounded ,
52- ) ,
48+ properties,
5349 } )
5450 }
5551
@@ -83,6 +79,10 @@ impl ExecutionPlan for LastRowByUniqueKeyExec {
8379 & self . properties
8480 }
8581
82+ fn maintains_input_order ( & self ) -> Vec < bool > {
83+ vec ! [ true ]
84+ }
85+
8686 fn children ( & self ) -> Vec < & Arc < dyn ExecutionPlan > > {
8787 vec ! [ & self . input]
8888 }
Original file line number Diff line number Diff line change @@ -691,11 +691,19 @@ impl CubeTable {
691691 ) ) ) ;
692692 }
693693 }
694- Arc :: new ( MemoryExec :: try_new (
695- & [ record_batches. clone ( ) ] ,
696- index_projection_schema. clone ( ) ,
697- index_projection_or_none_on_schema_match. clone ( ) ,
698- ) ?)
694+ Arc :: new (
695+ MemoryExec :: try_new (
696+ & [ record_batches. clone ( ) ] ,
697+ index_projection_schema. clone ( ) ,
698+ index_projection_or_none_on_schema_match. clone ( ) ,
699+ ) ?
700+ . with_sort_information ( vec ! [
701+ lex_ordering_for_index(
702+ self . index_snapshot. index. get_row( ) ,
703+ & index_projection_schema,
704+ ) ?,
705+ ] ) ,
706+ )
699707 } else {
700708 let remote_path = chunk. get_row ( ) . get_full_name ( chunk. get_id ( ) ) ;
701709 let local_path = self
You can’t perform that action at this time.
0 commit comments