github.com/square/finch@v0.0.0-20240412205204-6530c03e2b96/docs/content/syntax/params.md (about) 1 --- 2 weight: 5 3 --- 4 5 There are three types of parameters: user-defined, built-in, and environment variable. 6 7 {{< toc >}} 8 9 ## User-defined 10 11 User-defined parameters are defined in [\_all.yaml]({{< relref "syntax/all-file#params" >}}), and [stage files]({{< relref "syntax/stage-file" >}}), and by [`--param`]({{< relref "operate/command-line#--param" >}}) on the command line. 12 13 ```yaml 14 params: 15 foo: "bar" 16 rows: "100k" 17 ``` 18 19 * "$params.foo" → "bar" 20 * "$params.rows" → "100000" 21 22 The "$params." prefix is required. 23 It can be wrapped in curly braces: "${params.foo}". 24 25 ## Built-in 26 27 |Param|Value| 28 |----|------| 29 |$sys.CPU_CORES|Number of CPU cores detected by Go| 30 31 Built-in parameters are used as shown in the table above (no "$params." prefix). 32 33 ## Environment Variable 34 35 If a parameter isn't user-defined or built-in, Finch tries to fetch it as an environment variable. 36 For example, if `HOME=/home/finch`, then "$HOME" → "/home/finch". 37 38 ## Inheritance 39 40 {{< columns >}} <!-- begin columns block --> 41 _\_all.yaml_ 42 ```yaml 43 params: 44 foo: "bar" 45 rows: "100k" 46 ``` 47 <---> 48 _+ Stage File_ 49 ```yaml 50 stage: 51 params: 52 rows: "500" 53 clients: 16 54 ``` 55 <---> 56 _= Final Params_ 57 ``` 58 foo = bar 59 rows = 500 60 clients = 16 61 ``` 62 {{< /columns >}} 63 64 [`--param`]({{< relref "operate/command-line#--param" >}}) on the command line overrides all and sets the final value. 65 66 Reusing the example above, `--params rows=999` overrides both \_all.yaml and the stage file, setting final value rows = 999. 67 68 {{< hint type=tip >}} 69 Look for "param:" in the [`--debug`]({{< relref "operate/command-line#--debug" >}}) output to debug parameters processing. 70 {{< /hint >}}