OVERLAPS

Translation reference to convert the Teradata operator OVERLAPS to Snowflake Scripting.

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Description

According to Teradata's documentation, the OVERLAPS operator compares two or more period expressions. If they overlap, it returns true.

For more information regarding Teradata's OVERLAPS, check here.

period_expression
OVERLAPS
period_expression

The PERIOD_OVERLAPS_UDF is a Snowflake implementation of the OVERLAPS operator in Teradata.

Sample Source Pattern

Teradata

IN -> Teradata_01.sql
SELECT 
    PERIOD(DATE '2009-01-01', DATE '2010-09-24') 
    OVERLAPS
    PERIOD(DATE '2009-02-01', DATE '2009-06-24');

Snowflake Scripting

OUT -> Teradata_01.sql
SELECT
    PUBLIC.PERIOD_OVERLAPS_UDF(ARRAY_CONSTRUCT(PUBLIC.PERIOD_UDF(DATE '2009-01-01', DATE '2010-09-24') !!!RESOLVE EWI!!! /*** SSC-EWI-TD0053 - SNOWFLAKE DOES NOT SUPPORT THE PERIOD DATATYPE, ALL PERIODS ARE HANDLED AS VARCHAR INSTEAD ***/!!!, PUBLIC.PERIOD_UDF(DATE '2009-02-01', DATE '2009-06-24') !!!RESOLVE EWI!!! /*** SSC-EWI-TD0053 - SNOWFLAKE DOES NOT SUPPORT THE PERIOD DATATYPE, ALL PERIODS ARE HANDLED AS VARCHAR INSTEAD ***/!!!)) !!!RESOLVE EWI!!! /*** SSC-EWI-TD0053 - SNOWFLAKE DOES NOT SUPPORT THE PERIOD DATATYPE, ALL PERIODS ARE HANDLED AS VARCHAR INSTEAD ***/!!!;

Known Issues

1. Unsupported Period Expressions

The PERIOD(TIME WITH TIME ZONE) and PERIOD(TIMESTAMP WITH TIME ZONE) expressions are not supported yet.

  1. SSC-EWI-TD0053: Snowflake does not support the period datatype, all periods are handled as varchar instead

Last updated