Git Product home page Git Product logo

cortex-dag-generator's Introduction

Cortex CDC DAG generator for SAP

This generator reads the specified CDC table names, keys of the specified tables and merge table name and generates a merge query and a python script for each table for Cloud Composer or Apache Airflow. We recommend reading the instructions in the parent module, the Cortex Data Foundation.

Prerequisites:

The following steps must be completed before running this generator.

  • An existing BigQuery Source Dataset that holds all source tables, each of which with recordstamp and operation_flag columns. Adjust the files in the template_dag and template_sql if the fields have different names.
  • A GCS bucket created for holding the DAG python scripts and SQL scripts (target bucket).
  • A GCS bucket created for logs that this generator writes to (logs bucket).
  • config/config.json file with the values required for SAP deployment configuration as described in the Data Foundation README.
  • Replicated DD03L table

Configuration file for this repository is config/config.json.

Cloudbuild Parameters:

The cloudbuild.cdc.yaml for this generator requires the following parameters:

  • _GCS_BUCKET: GCS bucket created for logs that this generator writes to (logs bucket).

Run Options

  • Clone the repository into your Cloud Shell Editor or an IDE of your choice.
  • Ensure gcloud SDK is installed, if you choose your own IDE.
  • Makes changes in config/config.json as described in the Data Foundation README for SAP deployment (that README refers to config/config.json).
  • Make required changes in the settings.yaml to add / delete the required tables and run frequencies. Save the file. - Adjust the sets.yaml to add / delete the required SAP datasets to be flattened and run frequencies. Save the file.

The generator can be run from the Cloud Console using the gcloud builds submit ... command or by configuring a Cloud Builds trigger that runs automatically upon push to a Cloud Source Repository branch

Results

  • The generated python scripts will be copied to gs://<targetBucket>/dags
  • The generated SQL scripts will be copied to gs://<targetBucket>/data/bq_data_replication

targetBucket - is a GCS bucket created for holding the DAG python scripts and SQL scripts (targetBucket in config/config.json).

cortex-dag-generator's People

Contributors

fawix avatar funingg avatar lsubatin avatar txzebra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cortex-dag-generator's Issues

failed merge script run for EKKO and EKPO

Hello!

We checked the pipeline earlier that process the CDC tables for EKKO and EKPO and we noticed that it failed. I tried to run the merge script for both table in BQ and I'm getting an error like below. Not sure if you have encountered this or you have solutions on this.

ERROR: Too many partitions produced by query, allowed 4000, query produces at least 4001 partitions

Hopefully you can help us with this.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.