SQL task type used to connect to databases and execute SQL.
Refer to DataSource
Project -> Management-Project -> Name-Workflow Definition, and click the “Create Workflow” button to enter the DAG editing page.select type query, which is returned with a result set. You can specify three templates for email notification: form, attachment or form attachment. Non-queries return without a result set, three types of operations are: update, delete and insert.key1=value1;key2=value2....${variable} in the SQL statement.This example creates a temporary table tmp_hello_world in Hive and writes a row of data. Before creating a temporary table, we need to ensure that the table does not exist. So we use custom parameters to obtain the time of the day as the suffix of the table name every time we run, this task can run every different day. The format of the created table name is: tmp_hello_world_{yyyyMMdd}.
Log in to the bigdata cluster and use ‘hive’ command or ‘beeline’ or ‘JDBC’ and other methods to connect to the ‘Apache Hive’ for the query. The query SQL is select * from tmp_hello_world_{yyyyMMdd}, please replace {yyyyMMdd} with the date of the running day. The following shows the query screenshot:
Pay attention to the selection of SQL type. If it is an insert operation, need to change to “Non-Query” type.