Skip to content

[Bug] window function lag return invalid data #9033

@morningman

Description

@morningman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions