23 lines
791 B
Markdown
23 lines
791 B
Markdown
# Basic Graph - Random Number Generator
|
|
|
|
This example demonstrates a databuild_job that generates a random number seeded based on the partition ref.
|
|
|
|
## Multiple Configs
|
|
|
|
We can generate numbers for any partition provided (written to `/tmp/databuild_test/examples/basic_graph`), and so we have
|
|
a config per partition for demonstration purposes:
|
|
|
|
```bash
|
|
$ bazel run //:generate_number_job.cfg pippin salem sadie
|
|
{"outputs":["pippin"],"inputs":[],"args":["pippin"],"env":{}}
|
|
{"outputs":["salem"],"inputs":[],"args":["salem"],"env":{}}
|
|
{"outputs":["sadie"],"inputs":[],"args":["sadie"],"env":{}}
|
|
```
|
|
|
|
## Execute
|
|
|
|
Generates a random number based on the hash of the partition ref and writes it to the output file.
|
|
|
|
```bash
|
|
bazel run //:sum_job.cfg pippin_salem_sadie | bazel run //:sum_job
|
|
```
|