MaterializeInc/datagen

Feature: Allow fields to reuse previously generated values

chuck-alt-delete opened this issue · 0 comments

It would be great if a field could reuse the generated value from another field. This currently works with parent_field and child_field to specify a foreign key relationship in _meta.relationships, but we may want to extend that to other fields as well.

For example, suppose we want a field that takes the value of another field and increases it by a random number between 5 to 10. The most general solution might be to somehow allow referencing other fields by json path? This has the benefit that it would work for nested fields as well.

Dependent fields would have to come later in the order so the upstream field has a chance to get generated first.

Related issues

For Debezium change data capture, a record has before and after fields that wrap the values before and after the record changed in the upstream database. Often we'll want to include a field that didn't change, like a primary key id. But with the current implementation, there isn't a way for one field to reference the data generated in another field.