Hi Team ,
I am planning to create IF/ELSE condition task in databricks using terraform code . My requirement is
Task A ( Extract records from DB and Count recs) --> Task B ( validate the counts using Condition_task) --> Task c ( load data if Task B validate the counts >0)
I am able to implement it in databricks manually but trying to implement the same using Terraform code . Could you please help with this coditional task in data bricks . How can i refer "Total_record_counts' set in the task A is refered in Task b using condition task.
following sample code.
dynamic "task"{
for_each = var.map_of_tables # this is map variable of tables
content {
task_key = "${var.env}_validate_total_rec_count_${lower(task.key)}"
run_if = "ALL_SUCCESS"
depends_on{
task_key = "${var.env}_get_total_rec_count_${lower(task.key)}" -- Task to get the record counts
}
condition_task { # conditional task
left = "{{tasks.${var.env}_get_total_rec_count_${lower(task.key)}.values.total_rec_count}}" # facing issue with this how can i refer variable which was set in predecessor notebook task
op = "GREATER_THAN"
right = 0
}
Any help with sample code will be helpful