0

We have one main chain to load a table from a source db with 3 steps:

  1. Truncate local table
  2. Load table from source db
  3. Transform loaded table into another table.

Also, we created an additional chain inside step 2 to load that table by partitioned columns. However, when running the main chain, we are getting the following order:

Step1 --> Step2--> Step3--> Local Chain's Step1 ,etc

That is main chain's step 2 is creating a new local chain as it should, adding it to a job (create job statement), enabling the job and right after that leaving its program as completed even though local chain has just started. How can we add a condition to main chain step2 so that it will wait until the local chain is finished?

Here is the main chain:

CHAIN_NAME      STEP_NAME         PROGRAM_OWNER  PROGRAM_NAME
ACCOUNTS_CHAIN  TRUNCATE_ACC       DWH            TRUNCATE_TABLE_ACC
ACCOUNTS_CHAIN  INSERT_ACC         DWH            RUN_INS_IBS_ACC
ACCOUNTS_CHAIN  RUN_FILL_CORE_ACC  DWH            RUN_FILL_CORE_ACC

And scheduler job logs shows this:

LOG_ID     OWNER    JOB_NAME            JOB_SUBNAME          STATUS
97442436    DWH   LOAD_ACC_DB                                SUCCEEDED
97442300    DWH   BULK_LOAD_CHAIN_JOB                        SUCCEEDED
97442296    DWH   LOAD_ACC_DB           LOAD_FIL_01099       SUCCEEDED
97442294    DWH   LOAD_ACC_DB           LOAD_FIL_01137       SUCCEEDED
97442292    DWH   LOAD_ACC_DB           LOAD_FIL_01095       SUCCEEDED
97442290    DWH   LOAD_ACC_DB           LOAD_FIL_09055       SUCCEEDED
97442288    DWH   LOAD_ACC_DB           LOAD_FIL_01124       SUCCEEDED
97442286    DWH   LOAD_ACC_DB           LOAD_FIL_01057       SUCCEEDED
97442284    DWH   LOAD_ACC_DB           LOAD_FIL_01173       SUCCEEDED
97442282    DWH   LOAD_ACC_DB           LOAD_FIL_01103       SUCCEEDED
97442280    DWH   BULK_LOAD_CHAIN_JOB   RUN_FILL_CORE_ACC    SUCCEEDED
97442278    DWH   LOAD_ACC_DB           LOAD_FIL_01153       SUCCEEDED
97442276    DWH   LOAD_ACC_DB           LOAD_FIL_01102       SUCCEEDED
97442274    DWH   LOAD_ACC_DB           LOAD_FIL_01143       SUCCEEDED
97442270    DWH   BULK_LOAD_CHAIN_JOB   INSERT_ACC           SUCCEEDED
97442262    DWH   BULK_LOAD_CHAIN_JOB   TRUNCATE_ACC         SUCCEEDED

BULK_LOAD_CHAIN_JOB is a job that calls main chain ACCOUNTS_CHAIN
LOAD_ACC_DB is a job that calls local chain in step2.

Is looking for a count of LOAD_ACC_DB only way to check its completion? Or we have any mechanism in chains itself like if there is a nested chain the wait for child chain complete and then proceed to the next step?

Sherzodbek
  • 170
  • 1
  • 20

1 Answers1

0

It seems I had a confusing understanding of nested chain concepts in documentation. All I had to was entering the local chain name when defining main chains 2nd step instead of program name. After that correct order was established in chain runs.

Sherzodbek
  • 170
  • 1
  • 20