SameerMesiah97 opened a new pull request, #69362:
URL: https://github.com/apache/airflow/pull/69362

   **Description**
   
   This change introduces a new operator, `SQLBulkLoadOperator`, to bulk load 
tab-delimited files into SQL database tables.
   
   The operator delegates to the underlying hook's `bulk_load` implementation, 
allowing each SQL provider to use its native bulk loading mechanism through a 
common interface. It also supports optional `preoperator` and `postoperator` 
SQL statements to perform common setup and cleanup tasks as part of the bulk 
load workflow.
   
   **Rationale**
   
   `DbApiHook` already exposes a common `bulk_load` API, which is implemented 
by multiple SQL providers. However, unlike `run()` and `insert_rows()`, there 
is currently no corresponding operator that exposes this functionality to DAG 
authors.
   
   While the operator provides a convenient wrapper around the existing hook 
API, it also simplifies common bulk loading workflows by allowing setup and 
cleanup SQL to be executed as part of the same task. This avoids requiring 
users to implement custom `PythonOperator`s solely to orchestrate bulk loading 
operations.
   
   **Tests**
   
   Added unit tests verifying that:
   
   * `SQLBulkLoadOperator` correctly delegates to the underlying hook's 
`bulk_load` method.
   * Optional `preoperator` and `postoperator` SQL statements are executed 
before and after the bulk load operation, respectively.
   * Template fields are correctly rendered before invoking the underlying hook.
   
   **Example DAG**
   
   Added a new example DAG, `example_sql_bulk_load`, demonstrating how to bulk 
load a tab-delimited file into a SQL table using `SQLBulkLoadOperator`. The 
example also shows how to use `preoperator` and `postoperator` to prepare and 
clean up the destination table as part of the bulk load workflow.
   
   **Documentation**
   
   Added documentation for `SQLBulkLoadOperator`, including its supported 
parameters and a usage example.
   
   **Backwards Compatibility**
   
   This is a new operator and does not modify existing functionality. No 
breaking changes are introduced.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to