Referencing¶
A Computed File's query reads a single file pattern in the parent DFS datastore. This page covers what that file is allowed to be, how to work around the "one file only" restriction, and how a Computed File can compose with a Computed Join.
What a Computed File Can Reference¶
A Computed File can only reference base file patterns in the parent datastore:
| Source object | Allowed as a reference? |
|---|---|
| A base file container (physical files or a pattern) in the parent DFS datastore | |
| Other Computed Files in the same datastore | |
| Computed Tables (they live in JDBC and native datastores) | |
| Computed Joins | |
| Base file patterns in a different datastore | |
| More than one source pattern at a time |
The rule exists because Qualytics stores the Computed File's query as metadata; it does not create a new file on storage. Each run reads only the one file pattern the query names, and a query that names another Computed File or a second file is refused with an error that names the files it reads. See Workarounds below for two ways to structure your query when you would otherwise need to chain Computed Files.
Qualytics also requires the file pattern to be profiled at least once before a Computed File can read it. The query references field names, and those names are only known after the file has been profiled. If it has not been profiled yet, Validate and Save refuse the query; run a profile on the file (or wait for its next scheduled profile) and then come back to the Add Computed File dialog.
Workarounds for Referencing Other Computed Files¶
Because a Computed File cannot reference another Computed File, chained transformation logic has to be expressed either inside one query or by landing intermediate results upstream.
Fold Steps into One Query¶
Write each intermediate step as a common table expression (WITH step AS (...)) or a subquery over the same file, and select from it in the final step. Spark SQL functions like CASE WHEN, COALESCE, MAX_BY, COLLECT_LIST, window functions, and LATERAL VIEW cover most shaping in a single pass.
Materialize the Intermediate as a Base File Pattern¶
If you need to reuse the intermediate result across multiple Computed Files, land it as a real file (or file pattern) on DFS storage in your own upstream pipeline, sync it into Qualytics as a base file container, and read the synced pattern from your Computed File's query.
Using Computed Files in a Computed Join¶
A Computed File can be used as an input to a Computed Join as long as it has been profiled at least once. The Computed Join picks up the Computed File's field schema at the time of the join and treats it like any other container on either side. The only container type a Computed Join refuses is another Computed Join.