t_table_map(data, field, output_fields, missing=None, mode="fill-auto")
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | Target table (dimension table) | table | Yes | - | - |
field | Map the source field to the table in logs. If the corresponding field does not exist in logs, perform no operation. Supports String and String List. | any | Yes | - | - |
output_fields | Mapped fields, such as ["province", "pop"]. Supports String and String List. | any | Yes | - | - |
missing | When no match field is found, assign the parameter value to the output field output_fields. | String | No | - | - |
mode | Field coverage mode. Default is fill-auto. | String | No | fill-auto |

[{"user_id": 1},{"user_id": 3}]
//On the console, set the alias configuration of external data MySQL to hm, the db of mysql to test222, and the table name to test//Pull all data from MySQL and use the t_table_map function to join dimensional tablest_table_map(res_rds_mysql(alias="hm",database="test222",sql="select * from test"),"user_id",["gameid", "game"])
[{"user_id":"1"},{"game":"wangzhe","gameid":"123","user_id":"3"}]

[{"Pid": 1},{"Pid": 2},{"Pid": 3}]
//On the console, set the alias configuration of external data MySQL to hm, the db of mysql to test222, and the table name to test//Pull some data from MySQL and use the t_table_map function to join dimensional tables//The log field Pid relates to the id field in MySQL, with different names//Enrich the game_details field from MySQL, rename to game_info in logst_table_map(res_rds_mysql(alias="hm",database="test222",sql="select * from test where region='CN'"),[["Pid", "id"]],["game_name",["game_details","game_info"]])
[{"Pid":"1""game_info":"MOBA mobile game""game_name":"Honor of Kings"},{"Pid":"2"},{"Pid":"3""game_info":"open world RPG game""game_name":"Genshin Impact"}]
enrich_table("csv source data", "csv enrichment field", output="target field1, target field2, target field...", mode="overwrite")
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | For the input CSV data, the first line is column name and other lines are corresponding values. For example: region,count\\nbj, 200\\ngz, 300. | String | Yes | - | - |
fields | Name of the column to be matched. The field name in the CSV matches the field with the same name in the actual log. A single field name or multiple new field names concatenated with English half-width commas. | String | Yes | - | - |
output | Output field list. A single field name or multiple new field names concatenated with English half-width commas. | String | Yes | - | - |
mode | Write mode of the new field. | String | No | overwrite | - |
{"region": "gz"}
enrich_table("region,count\\nbj,200\\ngz,300", "region", output="count")
{"count":"300","region":"gz"}
enrich_dict ("JSON dictionary", "source field name", output=target field name, mode="overwrite")
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | Input dict data, which must be the escape string of JSON object, for example: {\\200\\":\\"SUCCESS\\". | String | Yes | - | - |
fields | Name of the field to be matched. When the key in dict is the same as the value corresponding to the specified field, the match succeeds. A single field name or multiple new field names concatenated with English half-width commas. | String | Yes | - | - |
output | Target field list. After successful matching, the function writes the corresponding values in the dict data to the target field list. The value can be a single field name or multiple new field names concatenated with commas. | String | Yes | - | - |
mode | Write mode of the new field. | String | No | overwrite |
{"status": "500"}
enrich_dict("{\\"200\\":\\"SUCCESS\\",\\"500\\":\\"FAILED\\"}", "status", output="message")
{"message":"FAILED","status":"500"}
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan