You can optimize an enterprise data warehouse with the Hadoop system to store more terabytes of data cheaply in the warehouse.
For example, you need to analyze customer portfolios by processing the records that have changed in a 24-hour time period. You can offload the data on Hadoop, find the customer records that have been inserted, deleted, and updated in the last 24 hours, and then update those records in your data warehouse. You can capture these changes even if the number of columns change or if the keys change in the source files.
To capture the changes, you can create the following mappings in the Developer tool:
Mapping_Day1
Create a mapping to read customer data from flat files in a local file system and write to an HDFS target for the first 24-hour period.
Mapping_Day2
Create a mapping to read customer data from flat files in a local file system and write to an HDFS target for the next 24-hour period.
m_CDC_DWHOptimization
Create a mapping to capture the changed data. The mapping reads data from HDFS and identifies the data that has changed. To increase performance, you configure the mapping to run on Hadoop cluster nodes in a Hadoop environment.
The following image shows the mapping m_CDC_DWHOptimization:
The mapping contains the following objects:
Read transformations. Transformations that read data from HDFS files that were the targets of Mapping_Day1 and Mapping_Day2. The Data Integration Service reads all of the data as a single column.
Expression transformations. Extract a key from the non-key values in the data. The expressions use the INSTR function and SUBSTR function to perform the extraction of key values.
Joiner transformation. Performs a full outer join on the two sources based on the keys generated by the Expression transformations.
Filter transformations. Use the output of the Joiner transformation to filter rows based on whether or not the rows should be updated, deleted, or inserted.
Write transformations. Transformations that write the data to three HDFS files based on whether the data is inserted, deleted, or updated.
Consolidated_Mapping
Create a mapping to consolidate the data in the HDFS files and load the data to the data warehouse.
The following figure shows the mapping Consolidated_Mapping:
The mapping contains the following objects:
Read transformations. Transformations that read data from HDFS files that were the target of the previous mapping are the sources of this mapping.
Expression transformations. Add the deleted, updated, or inserted tags to the data rows.
Union transformation. Combines the records.
Write transformation. Transformation that writes data to the flat file that acts as a staging location on the local file system.
You can open each mapping and right-click to run the mapping. To run all mappings in sequence, use a workflow.
The following image shows the example Data Warehouse Optimization workflow:
To run the workflow, use the infacmd wfs startWorkflow command.