Download presentation
Presentation is loading. Please wait.
Published byCathleen Nash Modified over 9 years ago
1
6 Copyright © 2009, Oracle. All rights reserved. Using the Data Transformation Operators
2
Copyright © 2009, Oracle. All rights reserved. 6 - 2 Objectives After completing this lesson, you should be able to: Describe the use of various Mapping Editor operators Use operators such as the Joiner, Lookup, Subquery Filter, Sequence, Splitter, and Pivot/Unpivot operators in mappings Identify the purpose and important properties of each of the operators
3
Copyright © 2009, Oracle. All rights reserved. 6 - 3 Lesson Agenda Overview of the following operators: –Joiner –Lookup –Subquery Filter –Sequence –Set –Splitter –Pivot/Unpivot –Aggregator –Constant –Transformation –Pre/Post Mapping Deploying and Executing
4
Copyright © 2009, Oracle. All rights reserved. 6 - 4 Component Palette This lesson focuses on some of these operators.
5
Copyright © 2009, Oracle. All rights reserved. 6 - 5 Using a Joiner A joiner is used to extract data from multiple sources and produce a single output row set. Set the condition in the Join Condition property in the Property Inspector panel. Click the ellipses (…) to start the Expression Builder.
6
Copyright © 2009, Oracle. All rights reserved. 6 - 6 Setting the Join Condition
7
Copyright © 2009, Oracle. All rights reserved. 6 - 7 Setting the Joiner Input Role T1T2Join Standard T1 Join T2 StandardOuter joinT1 LEFT OUTER JOIN T2 Outer JoinStandardT1 RIGHT OUTER JOIN T2 Outer Join T1 FULL OUTER JOIN T2
8
Copyright © 2009, Oracle. All rights reserved. 6 - 8 Lookup Operator Use the Lookup operator to look up data from a table, view, cube, or dimension.
9
Copyright © 2009, Oracle. All rights reserved. 6 - 9 Lookup Condition You have an option of Freestyle Editing. You can write any arbitrary SQL lookup condition in the Lookup Condition text box.
10
Copyright © 2009, Oracle. All rights reserved. 6 - 10 Handling Multiple Match Rows
11
Copyright © 2009, Oracle. All rights reserved. 6 - 11
12
Copyright © 2009, Oracle. All rights reserved. 6 - 12 Using the Subquery Filter Operator You can build a subquery quickly and simply. By default, the EXISTS condition is used. You can change the subquery filter input role to IN, NOT IN, or NOT EXISTS. Set the condition in the Subquery Filter Condition property in the Property Inspector panel. Click the ellipses (…) to start the Expression Builder.
13
Copyright © 2009, Oracle. All rights reserved. 6 - 13 Sequence Operator Generates sequential numbers that increment for each row Used to load identifiers that uniquely identifies each record in a table, or each level in a dimension Has two output groups: – NEXTVAL – CURRVAL
14
Copyright © 2009, Oracle. All rights reserved. 6 - 14 Set Operation Operator
15
Copyright © 2009, Oracle. All rights reserved. 6 - 15 Using the Splitter Operator for Multitable Insert Select Insert Split Insert
16
Copyright © 2009, Oracle. All rights reserved. 6 - 16 Quiz If you have to extract data from multiple sources and produce a single output row set, which operator will you use: a.Filter b.Sequence c.Splitter d.Joiner
17
Copyright © 2009, Oracle. All rights reserved. 6 - 17 Pivot and Unpivot Operators YearQ1_SALESQ2_SALESQ3_SALESQ4_SALES 200510000200004000080000 200612000240004800096000 2007160003200064000128000 YearQuarterSales 2005Q1_SALES10000 2006Q1_SALES12000 2007Q1_SALES16000 2005Q2_SALES20000 2006Q3_SALES48000 …… Pivot transformation operator enables you to transform a single row of attributes into multiple rows. Unpivot performs the reverse.
18
Copyright © 2009, Oracle. All rights reserved. 6 - 18 Wizard-Based Pivot Definition Click Input Attributes. Note that YEAR is selected as the key column as this remains the same for each pivoted row. Click Output Attributes or click Next. Note that QUARTER is selected as the Row locator column. This is the pivot column. Click Pivot transform. You define how the row is transformed from a row with columns to a number of rows.
19
Copyright © 2009, Oracle. All rights reserved. 6 - 19 Resulting Pivot Code and Mapping
20
Copyright © 2009, Oracle. All rights reserved. 6 - 20 Aggregator Operator Performs data aggregations, such as SUM and AVG, and provides an output row set with aggregated data. You can also define group by and having clause.
21
Copyright © 2009, Oracle. All rights reserved. 6 - 21 Aggregator Operator Add new output attributes here and in the Expression field click the ellipses to start the Expression Builder From the Function drop down list, select the function. Choose between ALL or DISTINCT. From the drop-down list, select the attribute on which the aggregation should be performed. Click Use Above Values to get the expression in the text area.
22
Copyright © 2009, Oracle. All rights reserved. 6 - 22 Using a Constant Operator Constant operator is used to provide constant values to target attributes.
23
Copyright © 2009, Oracle. All rights reserved. 6 - 23 Using the Expression Builder to Define a Constant Operator
24
Copyright © 2009, Oracle. All rights reserved. 6 - 24 Using the Transformation Operator Transformations are functions that are used to edit, cleanse, or change your data before it is loaded into the data warehouse. OWB currently supports: –SQL standard transformations –User-defined custom transform libraries –Sharing and reusability among modules –Local variables as inputs to a transformation
25
Copyright © 2009, Oracle. All rights reserved. 6 - 25 Transformation Library User-defined, custom- defined functions or procedures local to the project also appear here. Also, note Heterogeneous predefined categories of transformations. Makes available all applicable database functions Includes additional Warehouse Builder predefined functions and procedures Categorizes by transformation type for quick access
26
Copyright © 2009, Oracle. All rights reserved. 6 - 26 Transformation Details
27
Copyright © 2009, Oracle. All rights reserved. 6 - 27 Pre/Post Processing Operators Use Pre/Post Processing operators to perform processing before or after executing a mapping. Mapping Input Used to provide values into a mapping Mapping Output Used to send out values from a mapping Pre-Mapping Calls a procedure or function before executing the mapping Post-Mapping Calls a procedure or function after executing the mapping
28
Copyright © 2009, Oracle. All rights reserved. 6 - 28 Pre/Post Mapping Operator: Example Use a Pre-mapping process operator that will invoke a procedure to drop the indexes before the loading starts. Use a Post-mapping process operator that will invoke a procedure to re-create the indexes after the loading is complete.
29
Copyright © 2009, Oracle. All rights reserved. 6 - 29 Lesson Agenda Overview of the following operators: –Joiner –Lookup –Subquery Filter –Sequence –Set –Splitter –Pivot/Unpivot –Aggregator –Constant –Transformation –Pre/Post Mapping Deploying and Executing
30
Copyright © 2009, Oracle. All rights reserved. 6 - 30 Deploying Database Objects and Mappings Deployment is the process of creating a target system from the logical design or model. When you deploy database objects, they get created in the target schema. When you deploy a mapping, the scripts or packages are generated (.ddl,.pls and so on). When you deploy, you should make sure the objects are deployed in correct sequence. –For example, for a mapping to deploy successfully, the objects (tables, external tables, sequence, and so on) referenced in the mapping should have been deployed.
31
Copyright © 2009, Oracle. All rights reserved. 6 - 31 Deploying in Projects Navigator Panel Right-click the object and select Deploy. In the Log panel, view the deployment details. Note that the deploy process involves validation, script generation and finally the creation of the object. In case of mappings, the scripts or packages are generated (.ddl,.pls and so on)
32
Copyright © 2009, Oracle. All rights reserved. 6 - 32 Executing a Mapping
33
Copyright © 2009, Oracle. All rights reserved. 6 - 33 Quiz If you want to generate the total sales for each product, you will use the following operator in your mapping: a.Joiner b.Set c.Aggregator
34
Copyright © 2009, Oracle. All rights reserved. 6 - 34 Summary In this lesson, you should have learned how to: Describe the use of various transformation operators Use operators such as the joiner, lookup, subquery filter, sequence, splitter, and pivot/unpivot operators in mappings Identify the purpose and important properties of each of the operators
35
Copyright © 2009, Oracle. All rights reserved. 6 - 35 Practice 6-1 Overview: Using the Joiner, Sequence, and the Transformation Operator in a Mapping This practice covers the following topics: Creating a Mapping, MAP_GEOGRAPHY, that uses: –A Joiner operator to consolidate data from two staging tables, Stg_Countries and Stg_Regions. –A Sequence operator to populate a primary key column in the target –A sysdate Transformation operator to populate the Load_Date column.
36
Copyright © 2009, Oracle. All rights reserved. 6 - 36 Practice 6-2 Overview: Using the Subquery and the Lookup Operator This practice covers the following topics: Creating a mapping, LOAD_CONTACT, that uses the subquery filter and the Lookup operator. –The scenario: Get all the addresses of customers who have a high credit limit and are married. You use the Lookup operator to determine the city and the state from the address of customers.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.