1.0 - 8.00 - SeriesSplitter Example 1: Partition Splitter - 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)

Input

The input table has the daily stock prices from 1961 to 1962.

InputTable: company1_stock1
id name period stockprice
1 Company1 1961-05-1700:00:00 460
1 Company1 1961-05-1800:00:00 457
1 Company1 1961-05-1900:00:00 452
1 Company1 1961-05-2200:00:00 459
1 Company1 1961-05-2300:00:00 462
1 Company1 1961-05-2400:00:00 459
1 Company1 1961-05-2500:00:00 463
1 Company1 1961-05-2600:00:00 479
1 Company1 1961-05-2900:00:00 493
1 Company1 1961-05-3100:00:00 490
1 Company1 1961-06-0100:00:00 492
1 Company1 1961-06-0200:00:00 498
1 Company1 1961-06-0500:00:00 499
1 Company1 1961-06-0600:00:00 497
1 Company1 1961-06-0700:00:00 496
1 Company1 1961-06-0800:00:00 490
1 Company1 1961-06-0900:00:00 489
1 Company1 1961-06-1200:00:00 478
1 Company1 1961-06-1300:00:00 487
1 Company1 1961-06-1400:00:00 491
... ... ... ...

SQL Call

SELECT * FROM SeriesSplitter (
  ON company1_stock1 AS InputTable
  OUT TABLE OutputTable (company1_stock1_split)
  USING
  PartitionByColumns ('id')
  OrderByColumns ('period')
  SplitCount (50)
  Accumulate ('stockprice')
) AS dt ORDER BY statistics;

Output

This query returns the following table:

SELECT * FROM company1_stock1_split ORDER BY id, split_id;
company1_stock1_split
split_id id period stockprice
1-0 1 1961-05-1800:00:00 457
1-0 1 1961-05-1700:00:00 460
1-0 1 1961-05-2200:00:00 459
1-0 1 1961-05-2300:00:00 462
1-0 1 1961-05-2400:00:00 459
1-0 1 1961-05-1900:00:00 452
1-0 1 1961-05-2500:00:00 463
1-0 1 1961-05-2600:00:00 479
1-0 1 1900-01-0100:00:00  
1-0 1 1961-05-2900:00:00 493
1-1 1 1961-05-2600:00:00 479
1-1 1 1961-05-3100:00:00 490
1-1 1 1961-06-0200:00:00 498
1-1 1 1961-06-0500:00:00 499
1-1 1 1961-06-0600:00:00 497
1-1 1 1961-06-0700:00:00 496
1-1 1 1961-06-0800:00:00 490
1-1 1 1961-06-0100:00:00 492
1-1 1 1961-06-0900:00:00 489
1-1 1 1961-05-2900:00:00 493
1-10 1 1961-09-1800:00:00 543
1-10 1 1961-09-0800:00:00 541
1-10 1 1961-09-1500:00:00 547
1-10 1 1961-09-1400:00:00 549
1-10 1 1961-09-1300:00:00 545
1-10 1 1961-09-1200:00:00 549
1-10 1 1961-09-1100:00:00 545
1-10 1 1961-09-2100:00:00 532
1-10 1 1961-09-2000:00:00 539
1-10 1 1961-09-1900:00:00 540
1-11 1 1961-09-2000:00:00 539
1-11 1 1961-10-0200:00:00 541
1-11 1 1961-09-2900:00:00 541
1-11 1 1961-09-2800:00:00 538
1-11 1 1961-09-2700:00:00 542
1-11 1 1961-09-2600:00:00 540
1-11 1 1961-09-2500:00:00 527
1-11 1 1961-09-2200:00:00 517
1-11 1 1961-09-2100:00:00 532
1-11 1 1961-10-0300:00:00 547
... ... ... ...
stats_output
statistics value
input_table_row_count 369
input_partition_count 1
output_split_count 47
inserted_row_count 94
output_table_row_count 463
processing_time_in_seconds 5