SPL File convert.spl

Support for conversion between date and time representations, such as converting minutes to seconds.

Content

Functions

Functions

float64 days(int32 d)

Convert whole days to seconds as a float64. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:

// Set the retention to be five days
parameter retain: days(5);

Parameters

  • d: Days to convert to seconds

Returns

  • Number of seconds represented by d days.

float64 days(float64 days)

Convert days to seconds as a float64. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:

// Set the timeout to be one and a half days
parameter timeout: days(1.5);

Parameters

  • days: Days to convert to seconds

Returns

  • Number of seconds represented by d days.

float64 hours(int32 h)

Convert whole hours to seconds as a float64. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:

// Sliding window with a two hour eviction policy
// and five minute trigger policy
window IN: sliding, time(hours(2)), time(minutes(5));

Parameters

  • h: Hours to convert to seconds

Returns

  • Number of seconds represented by h hours.

float64 hours(float64 hours)

Convert hours to seconds as a float64. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:

// Set the period to be two hours
parameter period: hours(2);

Parameters

  • hours: Hours to convert to seconds

Returns

  • Number of seconds represented by hours.

float64 minutes(int32 mins)

Convert whole minutes to seconds as a float64. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:

// Set the period to be five minutes
parameter period: minutes(5);

Parameters

  • mins: Minutes to convert to seconds

Returns

  • Number of seconds represented by mins.

float64 minutes(float64 minutes)

Convert minutes to seconds as a float64. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:


// Tumbling window with a two and half minute eviction policy
window IN: tumbling, time(minutes(2.5));

Parameters

  • minutes: Minutes to convert to seconds

Returns

  • Number of seconds represented by minutes.

float64 seconds(int32 s)

Convert whole seconds to seconds as a float64. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:


// Tumbling window with 3 second eviction policy
window IN: tumbling, time(seconds(3));

Parameters

  • s: Number of seconds to return

Returns

  • Number of seconds represented by s.

float64 seconds(float64 seconds)

Returns the same value. This is useful for readable values in a time based window definitions or float64 operator parameters that represent seconds. For example:


// Tumbling window with 3 second eviction policy
window IN: tumbling, time(seconds(3.5));

Parameters

  • seconds: Number of seconds to return

Returns

  • seconds (the input value).