Package com.influxdb.query.dsl.functions
Class JoinFlux
java.lang.Object
com.influxdb.query.dsl.Flux
com.influxdb.query.dsl.functions.AbstractParametrizedFlux
com.influxdb.query.dsl.functions.JoinFlux
- All Implemented Interfaces:
Expression,HasImports
Join two time series together on time and the list of on keys.
See SPEC.
Options
- tables - Map of tables to join. Currently only two tables are allowed. [map of tables]
- on - List of tag keys that when equal produces a result set. [array of strings]
- method - An optional parameter that specifies the type of join to be performed.
Example
Flux cpu = Flux.from("telegraf")
.filter(Restrictions.and(Restrictions.measurement().equal("cpu"), Restrictions.field().equal("usage_user")))
.range(-30L, ChronoUnit.MINUTES);
Flux mem = Flux.from("telegraf")
.filter(Restrictions.and(Restrictions.measurement().equal("mem"), Restrictions.field().equal("used_percent")))
.range(-30L, ChronoUnit.MINUTES);
Flux flux = Flux.join()
.withTable("cpu", cpu)
.withTable("mem", mem)
.withOn("host")
.withMethod("outer");
- Author:
- Jakub Bednar (bednar@github) (17/07/2018 14:47)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.influxdb.query.dsl.Flux
functionsParameters, imports -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbeforeAppendOperatorName(StringBuilder operator, Map<String, Object> parameters) Possibility to customize function.voidcollectImports(Set<String> collectedImports) Collects all imports of the flux.protected StringwithMethod(JoinFlux.MethodType method) withMethod(String method) withOn(Collection<String> tags) Map of table to join.Methods inherited from class com.influxdb.query.dsl.functions.AbstractParametrizedFlux
appendActualMethods inherited from class com.influxdb.query.dsl.Flux
addImport, aggregateWindow, aggregateWindow, arrayFrom, arrayFrom, asVariable, columns, columns, count, count, covariance, covariance, covariance, covariance, covariance, covariance, covariance, covariance, covariance, cumulativeSum, cumulativeSum, cumulativeSum, derivative, derivative, difference, difference, difference, difference, difference, difference, distinct, distinct, drop, drop, drop, drop, duplicate, duplicate, elapsed, elapsed, elapsed, elapsed, expression, fill, fill, filter, filter, first, from, from, from, function, getImports, group, groupBy, groupBy, groupBy, groupExcept, groupExcept, groupExcept, integral, integral, interpolateLinear, interpolateLinear, join, join, keep, keep, keep, keep, last, last, limit, limit, limit, map, map, max, max, mean, mean, min, min, pivot, pivot, pivot, quantile, quantile, quantile, quantile, quantile, range, range, range, range, range, range, range, reduce, reduce, rename, rename, rename, sample, sample, sample, set, set, skew, skew, sort, sort, sort, sort, sort, sort, spread, spread, stddev, stddev, sum, sum, tail, tail, tail, timeShift, timeShift, timeShift, timeShift, to, to, to, to, to, to, to, to, toBool, toDuration, toFloat, toInt, toString, toString, toString, toStringConvert, toTime, toUInt, truncateTimeColumn, union, window, window, window, window, window, window, window, withFunction, withFunctionNamed, withPipedFunction, withPropertyNamed, withPropertyNamed, withPropertyValue, withPropertyValue, withPropertyValueEscaped, yield, yield
-
Constructor Details
-
JoinFlux
public JoinFlux()
-
-
Method Details
-
operatorName
- Specified by:
operatorNamein classAbstractParametrizedFlux- Returns:
- name of function
-
beforeAppendOperatorName
protected void beforeAppendOperatorName(@Nonnull StringBuilder operator, @Nonnull Map<String, Object> parameters) Description copied from class:AbstractParametrizedFluxPossibility to customize function.- Overrides:
beforeAppendOperatorNamein classAbstractParametrizedFlux- Parameters:
operator- current Flux functionparameters- parameters- See Also:
-
withTable
Map of table to join. Currently, only two tables are allowed.- Parameters:
name- table nametable- Flux script to map table- Returns:
- this
-
withOn
- Parameters:
tag- Tag key that when equal produces a result set.- Returns:
- this
-
withOn
- Parameters:
tags- List of tag keys that when equal produces a result set.- Returns:
- this
-
withOn
- Parameters:
tags- List of tag keys that when equal produces a result set.- Returns:
- this
-
withMethod
- Parameters:
method- the type of join to be performed- Returns:
- this
-
withMethod
- Parameters:
method- the type of join to be performed- Returns:
- this
-
collectImports
Description copied from class:FluxCollects all imports of the flux.- Overrides:
collectImportsin classFlux- Parameters:
collectedImports- a set to be filled by the used imports
-