A GATEKEEPER load step is used as a checkpoint to test if the execution of a load should proceed or stop. If the GATEKEEPER is fulfilled, execution of subsequent load steps will proceed. A GATEKEEPER is fulfilled when the logic returns a row/rows.
GATEKEEPER steps can be used alone or together with other load steps. It can also be used with automatically generated loads.
GATEKEEPER steps can be saved as part of a load template.
GATEKEEPER steps can use variables inside the SQL code.
Count rows in table
Create a GATEKEEPER which counts rows in a specific table. If the SELECT clause returns rows, load will continue. Logic can be used to verify that the source table is not empty before the load starts.
GATEKEEPER: SELECT COUNT(*) FROM pub.z_tmp_table_f_trip HAVING COUNT(*) > 0;
Executed SQL before load:
SELECT COUNT(*) FROM pub.z_tmp_table_f_trip HAVING COUNT(*) > 0;