databuild/examples/basic_graph
Stuart Axelbrooke ecee54da9f
Some checks are pending
/ setup (push) Waiting to run
commit
2025-06-29 19:28:46 -07:00
..
test Reorganize repo 2025-05-07 17:39:25 -07:00
.bazelrc colors everyhere 2025-05-03 20:52:39 -07:00
BUILD.bazel Reorganize repo 2025-05-07 17:39:25 -07:00
DataDep.java graph analyze 2025-04-18 22:35:20 -07:00
GenerateConfigure.java graph analyze 2025-04-18 22:35:20 -07:00
GenerateExecute.java Add scripts and fix tests 2025-05-03 20:31:46 -07:00
job_lookup.py graph analyze 2025-04-18 22:35:20 -07:00
JobConfig.java graph analyze 2025-04-18 22:35:20 -07:00
MODULE.bazel commit 2025-06-29 19:28:46 -07:00
MODULE.bazel.lock commit 2025-06-29 19:28:46 -07:00
README.md Add scripts and fix tests 2025-05-03 20:31:46 -07:00
SumConfigure.java Build working 2025-04-20 13:05:23 -07:00
SumExecute.java Build working 2025-04-20 13:05:23 -07:00

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:

$ 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.

bazel run //:sum_job.cfg pippin_salem_sadie | bazel run //:sum_job