Skip to content

[Bug]: window function issue. #23853

@Ariznawlll

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

d096066

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

drop database if exists percent_rank_func;
create database percent_rank_func;
use percent_rank_func;
drop table if exists test_pr_basic;
create table test_pr_basic (
id int primary key,
department varchar(50),
employee varchar(50),
salary decimal(10, 2)
);

insert into test_pr_basic values
(1, 'engineering', 'alice', 80000),
(2, 'engineering', 'bob', 90000),
(3, 'engineering', 'charlie', 90000),
(4, 'engineering', 'david', 100000),
(5, 'engineering', 'eve', 110000),
(6, 'sales', 'frank', 50000),
(7, 'sales', 'grace', 60000),
(8, 'sales', 'hank', 70000),
(9, 'hr', 'ivy', 65000),
(10, 'hr', 'jack', 65000);

select
department,
employee,
salary,
percent_rank() over (order by department, salary) as pct_rank
from test_pr_basic
order by department, salary;

drop table if exists test_pr_char;
create table test_pr_char (id int, val char(10));
insert into test_pr_char values (1, 'apple'), (2, 'banana'), (3, 'cherry'), (4, 'date');

select val, percent_rank() over (order by val) as pct_rank from test_pr_char order by val;

Expected Behavior

No response

Steps to Reproduce

bvt test

Additional information

No response

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingseverity/s0Extreme impact: Cause the application to break down and seriously affect the use

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions