validate target is used to execute a set of assertions in advance of the
BUILD phases. This is a
good place to validate any assumptions on the input data like primary key or record count.
targets: validate_input: kind: validate mode: failFast assertions: assert_primary_key: kind: sql tests: - query: "SELECT id,count(*) FROM source GROUP BY id HAVING count(*) > 0" expected:  assert_measurement_count: kind: sql tests: - query: "SELECT COUNT(*) FROM measurements_extracted" expected: 2
kind(mandatory) (type: string):
description(optional) (type: string): Optional descriptive text of the build target
assertions(optional) (type: map:assertion): Map of assertions to be executed. The validation is marked as failed if a single assertion fails.
mode(mandatory) (type: string) (default:
failFast): Specify how to proceed in case individual assertions fail. Possible values are
Supported Execution Phases#
VALIDATE- The specified assertions will be run in the
VALIDATEphase before the
Read more about execution phases.
validate target is always dirty for the
VALIDATE execution phase.
This build target works very similar to the
verify target, except that it is only active during the
VALIDATE phase and the default for the
mode parameter is set to
failFast. Here the assumption is that a validation
should check preconditions before a project is executed. If one of these preconditions fail, there is no value in
executing the rest of the project. So you want to fail as early as possible to save execution time.