Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default parameter (parameter 3) of LAG must be a constant #55334

Open
LZGH opened this issue Jan 22, 2025 · 0 comments
Open

The default parameter (parameter 3) of LAG must be a constant #55334

LZGH opened this issue Jan 22, 2025 · 0 comments

Comments

@LZGH
Copy link

LZGH commented Jan 22, 2025

Feature request

Is your feature request related to a problem? Please describe.

`
CREATE TABLE test_tbl (col_1 INT, col_2 INT)
DISTRIBUTED BY HASH(col_1);

INSERT INTO test_tbl VALUES
(1, NULL),
(2, 4),
(3, NULL),
(4, 2),
(5, NULL),
(6, 7),
(7, 6),
(8, 5),
(9, NULL),
(10, NULL);

SELECT col_1, col_2, LAG(col_2,2,col_1) OVER (ORDER BY col_1)
FROM test_tbl ORDER BY col_1;
`

Describe the solution you'd like

The third parameter of LAG supports fields of the same type.
fix 'The default parameter (parameter 3) of LAG must be a constant', 'The type of the third parameter of LEAD/LAG not match the type DATE' error
Describe alternatives you've considered

Additional context

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

No branches or pull requests

1 participant