Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

TIME_RANGE

TIME_RANGE

Determines the time range for the streaming events to be joined.
The
TIME_RANGE
function is applicable only for a Joiner transformation in a streaming mapping.

Syntax

TIME_RANGE(EventTime1,EventTime2,Format,Interval)
The following table describes the argument for this command:
Argument
Required/Optional
Description
EventTime1
Required
Date datatype. The time that a streaming event is generated in the master port of a Joiner transformation.
EventTime2
Required
Date datatype. The time that a streaming event is generated in the detail port of a Joiner transformation.
Format
Required
A format string that specifies the portion of the event time value you want to change. Enclose the format string within single quotation marks. For example, 'Seconds'. The format string is not case-sensitive.
The format argument accepts the following values:
  • Years
  • Months
  • Weeks
  • Days
  • Hours
  • Minutes
  • Seconds
  • Milliseconds
  • Microseconds
Interval
Required
An integer value which you want to change the event time value based on the format.

Return Value

NULL if you pass a null value to the function.

Example

The following example returns the time range expression for the Joiner transformation:
TIME_RANGE(EventTime1,EventTime2,'Second',4)
RETURN VALUE:
(EventTime1.<=(EventTime2).&&(EventTime2.<=(EventTime1.+(expr("INTERVAL 4 SECONDS")))))