...
- Open the target file type.
- Process the column list on the target file type. This is the file type which drives the entire operation.
- Verify that the reference file type (the type created in (2)) is exactly a subset of the source file type. If it isn't, an error is thrown.
- Compare both the source and the target using the reference file type from (2).
File Assertions
This part requires a little more explanation. This is what a minimal file assertion looks like in < 3.2.0:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
assert(file: 'name'); |
What this means is to compare a file named 'name', which is the output of some job, to a local file also named 'name'. Here is a complete example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
assert(
file: 'name',
target-file-name: 'target',
source-reference-file-type: 'src',
target-reference-file-type: 'tgt'
); |
Hopefully this illustrates the problem. Here, with target-file-name specified, file refers to the expected data file, what etlunit calls the target, and target-file-name refers to the actual file, what etlunit refers to as the source. Beyond that, though, since the file assertion shares it's implementation with the database assertion, the two file types, source and target, refer to target-file-name and file, respectively.