There are two ways to use the SeriesSplitter function with the time series manipulation function Interpolator:
- Call SeriesSplitter as in SeriesSplitter Example 1: Partition Splitter to create company1_stock_split and then call Interpolator:
SELECT * FROM Interpolator ( ON company1_stock1_split AS InputTable PARTITION BY id ORDER BY "period" USING TimeColumn ('period') TimeInterval (86400) InterpolationType ('linear') ValueColumns ('stockprice') Accumulate ('id') DuplicateRowsCount (2) ) AS dt;
- Combine the calls to SeriesSplitter and Interpolator:
SELECT * FROM Interpolator ( ON (SELECT * FROM SeriesSplitter ( ON company1_stock1 AS InputTable OUT TABLE OutputTable (company1_stock1_split) USING PartitionByColumns ('id') OrderByColumns ('period') SplitCount (50) Accumulate ('stockprice') ReturnStatsTable ('false') ) AS dt1 ) AS input_table PARTITION BY id ORDER BY period USING TimeColumn ('period') TimeInterval (86400) InterpolationType ('linear') ValueColumns ('stockprice') Accumulate ('id') DuplicateRowsCount (2) ) AS dt2;
The first choice performs better than the second choice.