Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed Oct 7, 2023
1 parent 4ede035 commit e96db51
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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; """



}

0 comments on commit e96db51

Please sign in to comment.