lookup¶
Type of operation: Join
Description¶
Find matching rows in a Resource or Interval dataset, making new columns in the output dataset.
The lookup verb takes a join predicate in the form of on(foo=@other.foo and bar=@other.bar ..)
, which defines what to look up by. The equality conditions in the predicate must follow one of the links. The remaining arguments should be of the form name:@target.value, which define what values to retrieve from the target dataset.
Usage¶
lookup [ predicate_1, predicate_2, ... ], [ columnbinding_1, columnbinding_2, ... ]
Argument |
Type |
Optional |
Repeatable |
Restrictions |
---|---|---|---|---|
predicate |
bool |
yes |
yes |
none |
columnbinding |
expression |
yes |
yes |
none |
Accelerable¶
lookup 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¶
lookup on([email protected] and [email protected]), hostname:@host.name, hostip:@host.ip
Using the values for ‘host_uid’ and ‘host_cluster’, look up the rows matching the same ‘uid’ and ‘cluster’ values in the input table named ‘host’. Extract the ‘name’ and ‘ip’ values from those ‘host’ dataset rows, using them populate new columns in the output called ‘hostname’ and ‘hostip’.