There are two ways to use Interpolation with SeriesSplitter:
- Call SeriesSplitter as in Example 1: Partition Splitter to create ibm_stock_split and then call Interpolator:
SELECT * FROM Interpolator ( ON ibm_stock1_split AS input_table PARTITION BY id ORDER BY "period" TimeColumn ('period') TimeInterval (86400) InterpolationType ('linear') ValueColumns ('stockprice') Accumulate ('id') DuplicateRowsCount (2) );
- Combine the calls to SeriesSplitter and Interpolator:
SELECT * FROM Interpolator ( ON (SELECT * FROM SeriesSplitter ( ON (SELECT 1) PARTITION BY 1 InputTable ('ibm_stock1') OutputTable ('ibm_stock1_split') PartitionByColumns ('id') OrderByColumns ('period') SplitCount (50) Accumulate ('stockprice') ReturnStatsTable ('false') ) ) AS input_table PARTITION BY id ORDER BY period TimeColumn ('period') TimeInterval (86400) InterpolationType ('linear') ValueColumns ('stockprice') Accumulate ('id') DuplicateRowsCount (2) );
The first choice, using separate SQL-MapReduce calls for SeriesSplitter and the function that uses it, provides better performance than the second choice.