APPLY PIPELINE
Overview
The Apply Pipeline component allows you to group multiple pipeline components as a unit, which can be bypassed as a group.
Syntax
Executes a pipeline block comprised of one or more pipeline components on the entire data set.
APPY PIPELINE (...) { BREAK_ON_EMPTY } { BYPASS } ;
BYPASS |
Bypasses the entire pipeline block |
BREAK_ON_EMPTY |
When specified, the pipeline will exit as soon as any of its ETL component returns 0 records |
Example 1
-- Get data from an RSS Feed SELECT * FROM HTTP [Rss Feed] (GET /econi.xml) APPLY TX (//item); -- Run a pipeline block that can be bypassed as a whole -- This transformation block happens after all the data -- has been read from the HTTP source APPLY PIPELINE ( -- Execute a statement which returns 0 records; the pipeline will exit immediately as a result EXEC ON DB [mysqldb] ( SELECT * FROM @pipelinedata() WHERE 1=0; ); -- will not execute because the BREAK_ON_EMPTY option is specified ADD COLUMN 'dateFound' WITH EXPRESSION '#utcnow()' IGNORE_IF_EXISTS; -- will not execute because the BREAK_ON_EMPTY option is specified APPLY SCHEMA ( datetime dateFound string(36) guid string(255) link _controlId|new column with a default value|#rndguid() ) BREAK_ON_EMPTY ; );