incubator-doris [Bug] window function lag return invalid data

hc2pp10m  于 2022-04-22  发布在  Java
关注(0)|答案(1)|浏览(141)

Search before asking

  • I had searched in the issues and found no similar issues.

Version

1.0.0-rc03

What's Wrong?

CREATE TABLE `wftest` ( `aa` varchar(10) NULL COMMENT "", `bb` text NULL COMMENT "", `cc` text NULL COMMENT "" ) ENGINE=OLAP UNIQUE KEY(`aa`) DISTRIBUTED BY HASH(`aa`) BUCKETS 3 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "in_memory" = "false", "storage_format" = "V2" );

insert into wftest values
('a','aa','/wyyt-image/2021/11/13/595345040188712460.jpg'),
('b','aa','/wyyt-image/2022/04/13/1434607674511761493.jpg'),
('c','cc','/wyyt-image/2022/04/13/1434607674511761493.jpg') 

mysql> select min(t.cc) over(PARTITION by t.cc  order by t.aa) ,lag(t.cc,1,'')over(PARTITION by t.cc  order by t.aa) as l1 from wftest t;
+------------------------------------------------+------------------------------------------------+
| min(`t`.`cc`) OVER(...)                        | l1                                             |
+------------------------------------------------+------------------------------------------------+
| /wyyt-image/2021/11/13/595345040188712460.jpg  |                                                |
| /wyyt-image/2022/04/13/1434607674511761493.jpg |                                                |
| /wyyt-image/2022/04/13/1434607674511761493.jpg |                 ` �7�  .       � �7�           |
+------------------------------------------------+------------------------------------------------+

column l1's result is wrong.

This query works well when set enable_vectorized_engine=true;

What You Expected?

valid result

How to Reproduce?

  • No response*

Anything Else?

  • No response*

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

相关问题