Normalize
Translation reference to convert Teradata Normalize functionality to Snowflake
Description
NORMALIZE specifies that period values in the first-period column that meet or overlap are combined to form a period that encompasses the individual period values. For more information about Normalize clause, see the Teradata documentation.
Sample Source Patterns
Sample data
CREATE TABLE project (
emp_id INTEGER,
project_name VARCHAR(20),
dept_id INTEGER,
duration PERIOD(DATE)
);
INSERT INTO project
VALUES
(
10,
'First Phase',
1000,
PERIOD(DATE '2010-01-10', DATE '2010-03-20')
);
INSERT INTO project
VALUES
(
10,
'First Phase',
2000,
PERIOD(DATE '2010-03-20', DATE '2010-07-15')
);
INSERT INTO project
VALUES
(
10,
'Second Phase',
2000,
PERIOD(DATE '2010-06-15', DATE '2010-08-18')
);
INSERT INTO project
VALUES
(
20,
'First Phase',
2000,
PERIOD(DATE '2010-03-10', DATE '2010-07-20')
);
INSERT INTO project
VALUES
(
20,
'Second Phase',
1000,
PERIOD(DATE '2020-05-10', DATE '2020-09-20')
);Normalize Clause
Suppose you want to use Normalize clause with the employee id.
20
(2010-03-10, 2010-07-20)
10
(2010-01-10, 2010-08-18)
20
(2020-05-10, 2010-09-20)
20
2020-05-10*2010-09-20
20
2010-03-10*2010-07-20
10
2010-01-10*2010-08-18
Known Issues
Normalize clause can use ON MEETS OR OVERLAPS, ON OVERLAPS or ON OVERLAPS OR MEETS, for these cases SnowConvert will add an error that this translation is planned for the future.
Related EWIs
SSC-EWI-0073: Pending Functional Equivalence Review.
SSC-EWI-TD0079: The required period type column was not found.
SSC-EWI-TD0053: Snowflake does not support the period datatype, all periods are handled as varchar instead.
Last updated
