You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following are examples of the `lookup` command syntax:
@@ -21,6 +21,8 @@ source = table1 | lookup table2 id as cid, name replace dept as department
21
21
source = table1 | lookup table2 id as cid, name replace dept as department, city as location
22
22
source = table1 | lookup table2 id as cid, name append dept as department
23
23
source = table1 | lookup table2 id as cid, name append dept as department, city as location
24
+
source = table1 | lookup table2 id as cid, name output dept as department
25
+
source = table1 | lookup table2 id as cid, name output dept as department, city as location
24
26
```
25
27
26
28
## Parameters
@@ -34,7 +36,7 @@ The `lookup` command supports the following parameters.
34
36
|`<sourceMappingField>`| Optional | A key from the source data (left side) used for matching, similar to a join key in the left table. Default is `lookupMappingField`. |
35
37
|`<inputField>`| Optional | A field in the lookup index whose matched values are applied to the results (output). Specify multiple fields as a comma-separated list. If not specified, all fields except `lookupMappingField` from the lookup index are applied to the results. |
36
38
|`<outputField>`| Optional | The name of the field in the results (output) in which matched values are placed. Specify multiple fields as a comma-separated list. If the `outputField` specifies an existing field in the source query, its values are replaced or appended with matched values from the `inputField`. If the field specified in the `outputField` is not an existing field, a new field is added to the results when using `replace`, or the operation fails when using `append`. |
37
-
| `(replace | append)` | Optional | Specifies how matched values are applied to the output. `replace` overwrites existing values with matched values from the lookup index. `append` fills only missing values in the results with matched values from the lookup index. Default is `replace`. |
39
+
|`(replace \| append \| output)`| Optional | Specifies how matched values are applied to the output. `replace` overwrites existing values with matched values from the lookup index. `append` fills only missing values in the results with matched values from the lookup index. `output` is a synonym for `replace` (provided for SPL compatibility). Default is `replace`. |
38
40
39
41
## Example 1: Replace existing values
40
42
@@ -121,4 +123,29 @@ The query returns the following results:
0 commit comments