SQL Operators¶
The AI Pipelines provides the following operators related to database connection:
Hive Operator
Mysql Operator
Mysql Writer Operator
Internal Influxdb Writer Operator
Internal Influxdb Reader Operator
TSDB Operator
Hive Operator¶
The Hive operator is used to process HIVE SQL, supports Hive SQL syntax, and can be used to create new tables and execute SQL query and other Hive calculation tasks. In the current operating environment of EnOS, Hive SQL cannot be executed across environments due to the network isolation between different environments.
Input Parameters Description¶
Name |
Required/Optional |
Type |
Description |
---|---|---|---|
data_source_name |
Required |
String |
Data source name from the data source connection configuration. |
sqls |
Required |
List |
Specify the SQL statement to be run (list type). Enter one list element per line. See the following sample of list elements: |
queue |
Optional |
String |
Specify the name of the big data queue required to run HIVE SQL, which is the name of the Batch Data Processing - Big Data Queue requested through the Resource Management. |
List Element Sample¶
If you need to enter ["a","b","c"]
, enter as follows:
"a"
"b"
"c"
If you need to enter [1,2,3]
, enter as follows:
1
2
3
Output Parameters Description¶
Name |
Type |
Description |
---|---|---|
resultset |
File |
Result set outputted after running HIVE SQL. |
Mysql Operator¶
The Mysql operator is used to process MySQL SQL, supports MySQL syntax, and can be used to create new tables, execute SQL query and other tasks.
Input Parameters Description¶
Name |
Required/Optional |
Type |
Description |
---|---|---|---|
data_source_name |
Required |
String |
Data source name from the data source connection configuration. |
sqls |
Required |
List |
Specify the MySQL statement that needs to be run. |
Output Parameters Description¶
Name |
Type |
Description |
---|---|---|
resultset |
File |
Result set outputted after running MySQL. |
Mysql Writer Operator¶
The Mysql Writer operator is used to insert data into specified MySQL database.
Input Parameters Description¶
Name |
Required/Optional |
Type |
Description |
---|---|---|---|
data_source_name |
Required |
String |
Data source name from the data source connection configuration. |
statement |
Required |
String |
Enter the MySQL statement. |
data |
Required |
File |
Specify the data that need to be inserted. |
skip_header |
Optional |
Boolean |
Specify whether to skip the header. Select |
Output Parameters Description¶
The Mysql Writer operator does not have fixed output parameters.
Internal Influxdb Writer Operator¶
The Internal Influxdb Writer operator is used to write data to the internal Influxdb storage.
Input Parameters Description¶
Name |
Required/Optional |
Type |
Description |
---|---|---|---|
data |
Required |
File |
Select the data that need to be written. |
table_name |
Required |
String |
Enter the table name. |
Output Parameters Description¶
Name |
Type |
Description |
---|---|---|
result |
String |
Results of the data writing. |
Internal Influxdb Reader Operator¶
The Internal Influxdb Reader operator is used to read data from the internal Influxdb storage.
Input Parameters Description¶
Name |
Required/Optional |
Type |
Description |
---|---|---|---|
sqls |
Required |
List |
Enter the MySQL statement. |
database |
Required |
String |
Enter the database name. The default value is app_portal. |
Output Parameters Description¶
Name |
Type |
Description |
---|---|---|
result |
Directory |
Directory of the data. |
TSDB Operator¶
The TSDB operator is used to get the raw data between a specified time range from the TSDB database.
Input Parameters Description¶
Name |
Required/Optional |
Type |
Description |
---|---|---|---|
raw_url |
Required |
String |
Enter the TSDB database address. |
access_key |
Required |
String |
Enter the AccessKey used to access the TSDB database. |
secret_key |
Required |
password |
Enter the SecretKey used to access the TSDB database. This field is displayed as blank when you enter the pipeline design page again after entering or updating the value. |
org_id |
Required |
String |
The organization ID which the asset belongs to. |
asset_ids |
Required |
List |
The asset ID. How to get asset ID>> |
point_ids |
Required |
List |
The measurement point ID. How to get measurement point ID>> |
start_time |
Required |
timestamp |
|
end_time |
Required |
timestamp |
The end time of the sampling data. Its format must be consistent with the start time. |
model_id |
Optional |
String |
The model ID. How to get model ID>> |
page_size |
Optional |
number |
The upper limit of the returned records in a single page for a single measurement point of a single device. |
with_quality |
Optional |
Boolean |
Specify whether the quality indicator is included in the response. Select |
local_time_accuracy |
Optional |
Boolean |
Specify whether millisecond precision with timestamp is included in the response. Select |
order_by |
Optional |
String |
Specify whether to sort the response according to a certain field. |
local_time_format |
Optional |
number |
Specify whether the local time value includes timezone information of devices. 0 excludes the timezone information, 1 includes the timezone information. |
item_format |
Optional |
number |
Specify the displaying format of the returned device data. Available options are 0, 1, and 2. For more information about each displaying format, see Item Format Example. |
boundary_type |
Optional |
String |
|
interval |
Optional |
number |
Specify the time interval for generating the interpolated data records when |
interpolation |
Optional |
String |
|
type |
Optional |
String |
|
Output Parameters Description¶
Name |
Type |
Description |
---|---|---|
result |
File |
Retrieved data. |