You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

To use these functions, the Interval Feature is required.

The interval feature provides arbitrary functions to work with intervals in a data stream and algebraic operator (+, *, -, /, ^) to perform interval addition, subtraction, multiplication, division, and exponentiation.

Example
SELECT toInterval(1.0,5.0) + toInterval(-2.0,3.0) FROM stream
=> [-1.0,8.0]
SELECT toInterval(1.0,5.0) - toInterval(-2.0,3.0) FROM stream
=> [-2.0,7.0]
SELECT toInterval(1.0,5.0) * toInterval(-2.0,3.0) FROM stream
=> [-10.0,15.0]
SELECT toInterval(1.0,5.0) / toInterval(-2.0,3.0) FROM stream
=> [-2.5,Infinity]

Union(Interval, Interval)

Computes the union of the two intervals.

Example
SELECT union(toInterval(1.0,5.0), toInterval(-2.0,3.0)) FROM stream
=> [-2.0,5.0]

Difference(Interval, Interval)

Computes the difference of the two intervals

Example
SELECT difference(toInterval(1.0,5.0), toInterval(-2.0,3.0)) FROM stream
=> [3.0,5.0]

Intersection(Interval, Interval)

Computes the intersection of the two intervals

Example
SELECT intersection(toInterval(1.0,5.0), toInterval(-2.0,3.0)) FROM stream
=> [1.0,3.0]

ToInterval(Number, Number)

Converts the given value to an interval value.

  • No labels