The function of the JSON Parsing operator has been introduced in Function Description of JSON Parsing. This document uses a simple example to illustrate the usage of this operator.
The book data is stored in JSON format in an API.Take the API URL https://demo.finedatalink.com/help/book.json as an example.
You may want to parse the data in JSON format into a two-dimensional table that can be directly analyzed, as shown in the following figure.
1. Create a scheduled task.
2. Drag a Data Transformation node onto the page, enter the Data Transformation editing page, and drag in an API Input operator, as shown in the following figure.
Configure Data Source to extract all data from the API, as shown in the following figure.
Take the API URL https://demo.finedatalink.com/help/book.json as an example.
Click Data Preview. The values of the store, store.book, and store.bicycle fields are in JSON format.You need to add a JSON Parsing operator to parse the data in JSON format.
This example parses the store.book field.
1. Add a JSON Parsing operator and connect it to the API Input operator.
2. Since this example is about parsing the store.book field, select the store.book field in Source Field. Do not select Keep All Upstream Output Fields After Parsing, so that only the data of the store.book field remains after parsing.Select all fields in Select JSON Node, as shown in the following figure.
1. If you want to parse the store and store.book fields, you can use two JSON Parsing operators in sequence to parse these fields separately.
2. For details about the JSON Parsing operator, see Function Description of JSON Parsing.
3. Click Data Preview. The store.book field after parsing is shown in the following figure.
1. Add a DB Table Output operator, connect it to the previous JSON Parsing operator, and configure the data destination, as shown in the following figure.
2. Click Save in the upper right corner.
1. Click Run to execute the task. The running result in Log upon successful execution is shown in the following figure.
2. The table data in the database is shown in the following figure.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy