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

WITH FILL with interpolation #21412

Closed
filimonov opened this issue Mar 3, 2021 · 4 comments
Closed

WITH FILL with interpolation #21412

filimonov opened this issue Mar 3, 2021 · 4 comments
Labels
feature st-discussion The story requires discussion /research / expert help / design & decomposition before will be taken

Comments

@filimonov
Copy link
Contributor

SELECT *
FROM values('pos UInt16, val UInt16', (1, 10), (13, 130), (15, 150), (20, 200))
ORDER BY pos ASC WITH FILL

Query id: 78385df6-a0cf-49e1-bf3b-440ae0b4c626

┌─pos─┬─val─┐
│   1 │  10 │
│   2 │   0 │
│   3 │   0 │
│   4 │   0 │
│   5 │   0 │
│   6 │   0 │
│   7 │   0 │
│   8 │   0 │
│   9 │   0 │
│  10 │   0 │
│  11 │   0 │
│  12 │   0 │
│  13 │ 130 │
│  14 │   0 │
│  15 │ 150 │
│  16 │   0 │
│  17 │   0 │
│  18 │   0 │
│  19 │   0 │
│  20 │ 200 │
└─────┴─────┘

20 rows in set. Elapsed: 0.001 sec. 

I want interpolated numbers instead of zeros in val column.

@amosbird
Copy link
Collaborator

amosbird commented Mar 4, 2021

I also need similar features. Perhaps we can provide WITH FILL with a lambda function with arguments: begin_value, previous_value, next_value, end_value, index.

@rhuddleston
Copy link

previous_value would be very helpful

@alexey-milovidov
Copy link
Member

It is easy to implement, but we need to figure out how to define the rules.
Especially if we want different rules for different columns, e.g. linear interpolation for numeric columns and filling with previous value for strings.

@alexey-milovidov alexey-milovidov added the st-discussion The story requires discussion /research / expert help / design & decomposition before will be taken label Jun 27, 2021
@den-crane
Copy link
Contributor

implemented #35349 22.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature st-discussion The story requires discussion /research / expert help / design & decomposition before will be taken
Projects
None yet
Development

No branches or pull requests

5 participants