1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- """
- A example workflow for task datax.
- This example will create a workflow named `task_datax`.
- `task_datax` is true workflow define and run task task_datax.
- You can create data sources `first_mysql` and `first_mysql` through UI.
- It creates a task to synchronize datax from the source database to the target database.
- """
- from pydolphinscheduler.core.process_definition import ProcessDefinition
- from pydolphinscheduler.tasks.datax import CustomDataX, DataX
- JSON_TEMPLATE = ""
- with ProcessDefinition(
- name="task_datax_example",
- tenant="tenant_exists",
- ) as pd:
-
-
- task1 = DataX(
- name="task_datax",
- datasource_name="first_mysql",
- datatarget_name="second_mysql",
- sql="select id, name, code, description from source_table",
- target_table="target_table",
- )
-
- task2 = CustomDataX(name="task_custom_datax", json=JSON_TEMPLATE)
- pd.run()
|