Hydra ETL
Build your first job
Get startedHydra CLILesson 7
Lesson 7 of 11 · Pass parameters

Change one value without touching the YAML

Declare one typed output-file parameter, override it at run time, and prove that the same job writes to the requested scope.

hdrctl run -Pabout 10 minutesverbose run complete

1. Objective

Goal

Add parameters.yaml, replace the destination filename with Hydra's documented {{ param:output_file }} placeholder, and run the job with -P output_file=scoped-output.csv.

Course project

Keep working from the cli-course folder. The job is named first-job, and the workflow lessons add workflow.yaml beside it; every command and terminal excerpt in this lesson was run against that same cumulative project.

Reading a result. Durations and process identifiers vary between machines — ignore them. What proves a run is the stable evidence: named files, resolved identifiers, row counters, step states, HTTP status. If one of those differs from the lesson, fix the previous step before continuing.

Prerequisites

  • Lesson 6 completed and checked.
  • The validated first-job CSV project.
  • A terminal opened in the cli-course folder.

2. Steps

01Declare the parameter

Objective

Give output_file a type, default, and description.

Actions

  1. Create first-job/parameters.yaml.
  2. Add the parameters mapping exactly as shown.
  3. Keep the default equal to the file used in earlier lessons.
parameters:
  output_file:
    type: string
    default: output.csv
    description: Output CSV file name
What you should see

The declaration preserves the earlier behavior when no override is passed.

parameters:
  output_file:
    type: string
    default: output.csv
    description: Output CSV file name

02Use the parameter in the destination

Objective

Resolve the destination filename while retaining the job-relative data folder.

Actions

  1. Open first-job/destinations.yaml.
  2. Replace only load.table.
  3. Use the colon form of Hydra's parameter placeholder.
load:
  table: "data/{{ param:output_file }}"
  mode: replace
What you should see

The destination path combines a stable folder with a runtime-resolved filename.

table: "data/{{ param:output_file }}"

03Override the filename

Objective

Run the unchanged pipeline with a one-command output scope.

Actions

  1. Pass one KEY=VALUE pair with -P.
  2. Use a filename without path traversal so output remains under data.
hdrctl run first-job -P output_file=scoped-output.csv
What you should see

The actual run succeeds with the same observed row counts.

✅ Pipeline completed successfully in 3.2s
Rows read   : 3
Rows written: 2

04Read the parameterized output

Objective

Prove that the override selected a new destination file.

Actions

  1. Open first-job/data/scoped-output.csv.
  2. Compare the rows with the default output from lesson 5.
Get-Content first-job\data\scoped-output.csv
What you should see

The requested file exists and contains the two filtered rows.

id,name,value
1,Alice,100.0
2,Bob,200.0

3. Checklist

VerificationExpected result
Parameter declarationoutput_file is a string with default output.csv
Placeholder grammarUses {{ param:output_file }}
Run resultReads 3 and writes 2 rows
Override evidencescoped-output.csv contains Alice and Bob

4. Troubleshooting

SymptomCauseFix
Parameter is unresolvedThe placeholder spelling differs from the declarationUse the same output_file key in both files
CLI rejects the argumentThe pair has no equals signPass -P output_file=scoped-output.csv
The default file is writtenThe override was omitted or placed after a shell parsing errorCopy the exact command and keep the value unquoted unless it contains spaces

5. Next lesson

The job can now change its output scope without manifest edits. The next lesson inventories the containing project with hdrctl list and reads what that structural scan does—and does not—prove.

Close by

0 / 0 on this page