set_valid_to

Type of operation: Metadata

Description

Declare the ‘valid to’ of the output to be the named column, which must be a timestamp column. Omitting the column name will clear the ‘valid to’, changing an interval input to a point-time output. This is a low-level function that will generate confusing results if not used as part of a larger context. It is recommended to instead use ‘make_resource’ or ‘update_resource’ or ‘timechart’ to go from event to resource, and ‘make_event’ to go from resource to event shape. If you absolutely need this: Beware changing time to a value that is too far off from the current timestamp field, because it may end up falling outside of the processing time window. Also, setting a “valid to” that’s before the “valid from” time will cause the datum to be filtered out by subsequent packing.

The valid to value must be a column that already exists, not an expression, and must be a timestamp type, so you may need to re-shape columns with make_col before you use this verb.

Usage

set_valid_to [ options ] [ , columnname ]

Argument

Type

Required

Multiple

options

options

Optional

Only one

columnname

fieldref

Optional

Only one

Options

Option

Type

Meaning

max_time_diff

duration

The new timestamp will be no further away from the old timestamp than this (default 1h)

Accelerable

set_valid_to is always accelerable if the input is accelerable. A dataset that only uses accelerable verbs can be accelerated, making queries on the dataset respond faster.

Examples

set_valid_to ts_col

Sets the ‘valid to’ designation of the output dataset as the ‘ts_col’ field.

set_valid_to options(max_time_diff:duration_hr(1)), ts_col

Sets the ‘valid to’ designation of the output dataset as the ‘ts_col’ field, and the maximum time difference between the original ‘valid to’ and ‘ts_col’ is less than one hour.

set_valid_to

Removes the ‘valid to’ designation from the output dataset

Aliases

  • setvt (deprecated)