github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/mquery_refer_table.en.md (about)

     1  ### `mquery_refer_table()` {#fn-mquery-refer-table}
     2  
     3  Function prototype: `fn mquery_refer_table(table_name: str, keys: list, values: list)`
     4  
     5  Function description: Query the external reference table by specifying multiple keys, and append all columns of the first row of the query result to field. This function does not work with central Pipeline.
     6  
     7  Function parameters:
     8  
     9  - `table_name`: the name of the table to be looked up
    10  - `keys`: a list of multiple column names
    11  - `values`: the values corresponding to each column
    12  
    13  Example:
    14  
    15  ```python
    16  json(_, table)
    17  json(_, key)
    18  json(_, value)
    19  
    20  # Query and append the data of the current column, which is added to the data as a field by default
    21  mquery_refer_table(table, values=[value, false], keys=[key, "col4"])
    22  
    23  # result
    24  
    25  # {
    26  #   "col": "ab",
    27  #   "col2": 1234,
    28  #   "col3": 1235,
    29  #   "col4": false,
    30  #   "key": "col2",
    31  #   "message": "{\"table\": \"table_abc\", \"key\": \"col2\", \"value\": 1234.0}",
    32  #   "status": "unknown",
    33  #   "table": "table_abc",
    34  #   "time": "2022-08-16T16:23:31.940600281+08:00",
    35  #   "value": 1234
    36  # }
    37  
    38  ```