Read Data¶
Read data by providing SQL query through the specified channel.
Prerequisites¶
Read channels are created and started in the organization.
Request Format¶
POST https://{apigw-address}/data-federation/v2.0/channels/read/{channelId}
Request Parameters (Header)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
Content-Type |
Mandatory |
String |
Content or file type. The default value is application/json. |
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Mandatory |
String |
Your organization ID. How to get the orgId>> |
channelId |
Path |
Mandatory |
String |
Channel ID |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
sqlQuery |
Mandatory |
String |
SQL query for getting data from storage systems. |
source |
Optional |
String |
For channels with cross-source analysis disabled, specify the alias of the data source. |
queue |
Optional |
String |
Specify the priority of the data query job. Options are Hot, Warm, and Cold. The Hot queue has the highest priority, the Warm queue has the medium priority, and the Cold queue has the lowest priority. |
itemFormat |
Optional |
String |
Reserved parameter for specifying the format of returned JSON. This field is currently inactive. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
List<Object> |
Data that is returned by the SQL query. For more information, see Returned Data Struct |
Returned Data Struct¶
Name |
Data Type |
Description |
---|---|---|
columns |
String |
Column name. |
metadata |
String |
Meta data. |
queryState |
String |
Data querying state. |
rows |
List<Object> |
Rows of data. For more information, see Data Row Struct |
Data Row Struct¶
Name |
Data Type |
Description |
---|---|---|
COLUMN_NAME |
String |
Column name. |
DATA_TYPE |
String |
Data type. |
IS_NULLABLE |
String |
Data type. |
Sample¶
Request Sample¶
url: https://{apigw-address}/data-federation/v2.0/channels/read/{channelId}?orgId={}
method: POST
requestBody:
{
"sqlQuery": "show schemas"
}
Return Sample¶
{
"msg": "OK",
"code": 0,
"data": {
"metadata": ["VARCHAR"],
"columns": ["SCHEMA_NAME"],
"queryState": "COMPLETED",
"rows": []
}
}