coalesce(x, (lag(x, 1)+lag(x, -1))/2)
From there you can go crazy and define whatever insane interpolations you want.
One limitation is that you can't distinguish the data boundaries from missing values (nulls at the edges vs. nulls in the bulk).
I guess another limitation is if you have multiple nulls after each other...
From there you can go crazy and define whatever insane interpolations you want.
One limitation is that you can't distinguish the data boundaries from missing values (nulls at the edges vs. nulls in the bulk).
I guess another limitation is if you have multiple nulls after each other...