-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
dcde622
commit 05df6ca
Showing
7 changed files
with
159 additions
and
116 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,14 +1,41 @@ | ||
# Metadata-Driven-Transformation-Framework (MDTF) | ||
A Postgres Based Meta Data Driven Transformation Framework to leverage column. | ||
A Postgres program that enables users to create transformation logic using a data driven approach. | ||
|
||
TL;DR Insert information into tables. Run some code, it performs some transformations for you. | ||
|
||
## Introduction | ||
Want to use a data driven approach to creating your transformation logic? This framework is for you. | ||
|
||
## Problems | ||
### Problem it is trying to solve | ||
- Have multiple inputs that are of a similar nature, but have different column names or have some level of complexity. | ||
- Allowing for a SQL Code first approach to generating transformation logic, and allowing for the leveraging of information schema. | ||
|
||
|
||
## Diagram | ||
## Transformation Core Concepts | ||
|
||
![Diagram of Meta Data Driven Framework](docs/assets/mtfdiagram.png) | ||
### Diagram | ||
![Diagram of Meta Data Driven Framework](docs/assets/mtfdiagram.png) | ||
|
||
### Transformations | ||
This entity represents a transformation that is applied to a table. | ||
Consider this the table you ```INSERT INTO``` | ||
|
||
### Target Mapping | ||
This represents an output column, of which there can be many inputs to. A target mapping can have a function applied to it to transform the data. | ||
Consider this the column you ```INSERT INTO``` | ||
|
||
### Function | ||
The definition of a function that can be applied to a target mapping. | ||
Consider this the function you apply to a column in a ```SELECT``` statement. | ||
|
||
### Function Input | ||
The definitions of the inputs which can be inserted into a function. | ||
Consider this the parameters you pass to a function in a ```SELECT``` statement. | ||
|
||
|
||
### Join Mappings | ||
The definitions of tables to join to when performing a transformation. | ||
Consider this the tables you ```JOIN``` to in a ```SELECT``` statement. | ||
|
||
|
||
## Usage |
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,18 @@ | ||
/* | ||
Defines the enum which is used on joins to refer to functions! | ||
When you add a function you simply add it to this enum so that there is a level of typing between the function names and there reference | ||
*/ | ||
|
||
SET SEARCH_PATH=mtf; | ||
|
||
-- Inserting predefined functions into the functions table | ||
TRUNCATE TABLE functions CASCADE; | ||
INSERT INTO functions (function_name, function_definition) | ||
VALUES | ||
('', 'Directly assigns values without transformation'), | ||
('safe_to_timestamp', 'Converts string to timestamp safely'), | ||
('str_to_boolean', 'Returns a fixed boolean value'), | ||
('return_enum', 'Returns a specified enum value'); | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SET SEARCH_PATH=mtf; | ||
CREATE OR REPLACE FUNCTION safe_to_timestamp(text, text) | ||
RETURNS TIMESTAMP AS $$ | ||
BEGIN | ||
|
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