This section describes how to use the DWS SQL operator to develop a job on DataArts Factory.
This tutorial describes how to develop a DWS job to collect the sales volume of a store on the previous day.
Before developing a DWS SQL job, you must create a data connection to DWS on the Manage Data Connections page of Management Center. The data connection name is dws_link.
The key parameters are as follows:
Create a gaussdb database by following the instructions in Creating a Database.
Create tables trade_log and trade_report in the gaussdb database. The following is an example script for creating the tables:
create schema store_sales; set current_schema= store_sales; drop table if exists trade_log; CREATE TABLE trade_log ( sn VARCHAR(16), trade_time DATE, trade_count INTEGER(8) ); set current_schema= store_sales; drop table if exists trade_report; CREATE TABLE trade_report ( rq DATE, trade_total INTEGER(8) );
Choose Development > Develop Script and create a DWS SQL script named dws_sql. Enter an SQL statement in the editor to collect the sales amount of the previous day.
Key notes:
After developing the DWS SQL script, create a job for periodically executing the DWS SQL script.
Key properties:
#{Job.getYesterday("yyyy-MM-dd")}
Parameter descriptions:
From Aug 6 to Aug 31 in 2021, the job was executed once at 02:00 every day.