1.0 - 8.00 - SeriesSplitter Example 2 : Using SeriesSplitter with Interpolator - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)
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.