diff --git a/regression-test/data/ssb_unique_sql_zstd_p0/partition_sort_node/test_partiiton_sort.out b/regression-test/data/ssb_unique_sql_zstd_p0/partition_sort_node/test_partiiton_sort.out new file mode 100644 index 00000000000000..d3b43d68940f13 --- /dev/null +++ b/regression-test/data/ssb_unique_sql_zstd_p0/partition_sort_node/test_partiiton_sort.out @@ -0,0 +1,24 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !select0 -- +20000 + +-- !select1 -- +7463 92 14 14 13 + +-- !select2 -- +aquamarine blue seashell 14 + +-- !select3 -- +aquamarine blue peru 11 +lace blue spring 11 +indian coral smoke 11 + +-- !select4 -- +aquamarine blue peru 10 +beige blanched thistle 10 +indian coral seashell 10 +bisque orange violet 10 +lace blue midnight 10 +beige forest white 10 +blush frosted thistle 10 + diff --git a/regression-test/suites/ssb_unique_sql_zstd_p0/partition_sort_node/test_partiiton_sort.groovy b/regression-test/suites/ssb_unique_sql_zstd_p0/partition_sort_node/test_partiiton_sort.groovy new file mode 100644 index 00000000000000..236b01643da879 --- /dev/null +++ b/regression-test/suites/ssb_unique_sql_zstd_p0/partition_sort_node/test_partiiton_sort.groovy @@ -0,0 +1,34 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("test_partition_sort") { + sql "use regression_test_ssb_unique_sql_zstd_p0" + qt_select0 """ select count() from part; """ + qt_select1 """ select count(distinct p_name), count(distinct p_color),count(distinct rn),count(distinct rk),count(distinct dr) from ( + select p_name, p_color , row_number() over(partition by p_name order by p_color) as rn,rank() over(partition by p_name order by p_color) as rk, + dense_rank() over(partition by p_name order by p_color) as dr from part) as t; """ + + qt_select2 """ select * from ( + select p_name, p_color , row_number() over(partition by p_name order by p_color) as rn from part) as t where rn=14; """ + + qt_select3 """ select * from ( select p_name, p_color , rank() over(partition by p_name order by p_color) as rn from part) as t where rn=11; """ + + qt_select4 """ select * from ( select p_name, p_color , dense_rank() over(partition by p_name order by p_color) as rn from part) as t where rn=10; """ + + + +} \ No newline at end of file