Skip to content

[BUG] Use of lead and lag at the same time may be garbled #6343

@xinyiZzz

Description

@xinyiZzz

To Reproduce
create table:

CREATE TABLE `test_table` (
  `a` varchar(32) NOT NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`a`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`a`) BUCKETS 2
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);

Load twice

INSERT INTO test_table (a) VALUES ("aaa"), ("aaa"), ("abc"), ("abc"), (11), (11), (22); 
INSERT INTO test_table (a) VALUES ("aaa"), ("aaa"), ("abc"), ("abc"), (11), (11), (22); 

query:

select  
	lead(a,1,null) over(partition by a) as t1,
	lag(a,1,null) over(partition by a) as t2
from test_table

result:
infoflow 2021-07-29 21-39-55

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions