News for hackers. Stuff that matters.
Re:Function pipelines: Building functional programming into ... by ccleve on Tuesday October 19, 2021 @02:05PM (#28921346)
Duplicating my question to Lockerman below. Sorry for the double post.

Is the -> operator just syntactic sugar? Is this:

SELECT device_id, timevector(ts, val) -> sort() -> delta() -> abs() -> sum() as volatility

the same as this?

SELECT device_id, sum(abs(delta(sort(timevector(ts, val))))) as volatility

Re:Function pipelines: Building functional programming into ... by WireBaron on Tuesday October 19, 2021 @02:57PM (#28922016)
This is essentially correct. It's a little more complicated inside, and the expansion's really more like:

SELECT device_id, arrow_run_pipeline(timevector(ts, val), arrow_add_element(sort(), arrow_add_element(delta(), arrow_add_element(abs(), sum())));

The notable difference here is that this presents a lot more optimization potential, as the entire pipeline can conceivably be applied in one pass through the table.

Re:Function pipelines: Building functional programming into ... by djk447 on Tuesday October 19, 2021 @02:48PM (#28921876)
Sorry I missed before was out grabbing lunch, answered above!