Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: mmarinelliHello. You'll want to use the looping operators to produce a set of rows which fill the gap you've identified with the Interval Inspection node. An example is provided below, which can be copied into a Filter node and executed. There is one important proviso on this method, however: This assumes that the source data conforms exactly to a sequence spaced at fixed intervals. If the interval in the data source were actually variable, for example if you had source records with IDs of 1, 1.24, 3, 4, 5.2, and 6, and your record set was missing 1.24 and 5.2, your attempt to identify the missing records given an interval of 1 may yield misleading results, as it would only produce 2 and 5 rather than the actual source values.
--- script follows ---
# define output metadata with a null record
output 1
{
emit long(null) as _MISSING_ID
where false
}
# set variables which define range begin/end and first missing ID
_RANGE_BEGIN = Previous
_RANGE_END = Current
_ITERATOR = _RANGE_BEGIN + Interval
# create a new record with a missing ID for each interval step within the gap
while (_ITERATOR < _RANGE_END)
{
do output 1
{
emit _ITERATOR as _MISSING_ID
}
_ITERATOR = _ITERATOR + Interval
}