Skip to content

[Bug] Windows function lag()/lead() function throw AnalysisException #4665

Description

@HappenLee

Describe the bug
There is a table:

CREATE TABLE `baseall` (
`k1` tinyint(4) NULL COMMENT "",
`k2` smallint(6) NULL COMMENT "",
`k3` int(11) NULL COMMENT "",
`k4` bigint(20) NULL COMMENT "",
`k5` decimal(9, 3) NULL COMMENT "",
`k6` char(5) NULL COMMENT "",
`k10` date NULL COMMENT "",
`k11` datetime NULL COMMENT "",
`k7` varchar(20) NULL COMMENT "",
`k8` double MAX NULL COMMENT "",
`k9` float SUM NULL COMMENT ""
) ENGINE=OLAP
AGGREGATE KEY(`k1`, `k2`, `k3`, `k4`, `k5`, `k6`, `k10`, `k11`, `k7`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`k1`) BUCKETS 5
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "V2"
);

query:

select k7, k10 , k5, lag(k5, 1, 0) over (partition by k7 order by k10) as new_k5 from baseall;

will cause exception:

[Code: 1064, SQL State: 42000] Type = VARCHAR() can't not convert to VARCHAR()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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