-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2023-2024 Broadcom | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import logging | ||
|
||
from vdk.api.job_input import IJobInput | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def run(job_input: IJobInput): | ||
""" | ||
Function named `run` is required in order for a python script to be recognized as a Data Job Python step and executed. | ||
VDK provides to every python step an object - job_input - that has methods for: | ||
* executing queries to OLAP Database; | ||
* ingesting data into a database; | ||
* processing data into a database. | ||
See IJobInput documentation for more details. | ||
""" | ||
log.info(f"Starting job step {__name__}") | ||
|
||
def sample_check(random_table_name): | ||
return True | ||
|
||
# Write your python code inside here ... for example: | ||
job_input.execute_template( | ||
template_name='scd_upsert', | ||
template_args={ | ||
'source_schema': 'starshot_internal_dw_stg', | ||
'source_view': 'sbuldeev_vw_template_test', | ||
'target_schema': 'starshot_internal_dw_stg', | ||
'target_table': 'sbuldeev_dw_template_test', | ||
'id_column': 'org_id', | ||
'check': sample_check | ||
}, | ||
database="trino", | ||
) | ||
|
||
job_input.execute_query("SELECT 1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
; Supported format: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure | ||
|
||
; This is the only file required to deploy a Data Job. | ||
; Read more to understand what each option means: | ||
|
||
; Information about the owner of the Data Job | ||
[owner] | ||
|
||
; Team is a way to group Data Jobs that belonged to the same team. | ||
team = my-team | ||
|
||
; Configuration related to running data jobs | ||
[job] | ||
; For format see https://en.wikipedia.org/wiki/Cron | ||
; The cron expression is evaluated in UTC time. | ||
; If it is time for a new job run and the previous job run hasn’t finished yet, | ||
; the cron job waits until the previous execution has finished. | ||
schedule_cron = 11 23 5 8 1 | ||
|
||
[vdk] | ||
db_default_type=trino | ||
trino_user=sb004367 | ||
trino_password=1597415974Ss%% | ||
trino_host=trino.broadcom.net | ||
trino_port=443 | ||
trino_schema=sc_hms | ||
trino_use_ssl=True | ||
trino_catalog=sc_hms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Python jobs can specify extra library dependencies in requirements.txt file. | ||
# See https://pip.readthedocs.io/en/stable/user_guide/#requirements-files | ||
# The file is optional and can be deleted if no extra library dependencies are necessary. |