com.informatica.powercenter.sdk.mapfwk.core
Class RankTransformation
java.lang.Object
com.informatica.powercenter.sdk.mapfwk.core.Table
com.informatica.powercenter.sdk.mapfwk.core.Transformation
com.informatica.powercenter.sdk.mapfwk.core.RankTransformation
- All Implemented Interfaces:
- Transform
public class RankTransformation
- extends Transformation
The following class encaspulates the creation of Rank transformation which
extends Transformation.
Rank Transformation is used to select only top or bottom Rank data. It can be
used to return largest or smallest numeric value in a port or group. During a
session with Rank the PowerCentre caches input data untill it performs Rank
calculation.
The code snippet for creating the Rank Transformation is
//create a Rank Transformation using the constructor given below:
Mapping mapping = ...; // mapping to which the transform should be added
Vector vInputSets = ...; // collection of InputSet objects
int rank = ...; // the rank integer
String rankPort = ...; // the port on which the rank should be applied
String[] groupBy = ...; // group by criteria
boolean top = ...; // boolean value specifying whether the rank is top to bottom or other way round
Vector vTransformFields = ...; // collection of TransformField objects
TransformationProperties props = ...; // properties
RankTransformation rankTrans = new RankTransformation( "RankTrans", "RankTrans",
"This is rank transformation", "RankTrans",
mapping, vInputSets, rank, rankPort, groupBy,
top, vTransformFields, props );
//apply the transformation
OutputSet outputSet = rankTrans.apply();
//get the first rowset as Rank always returns a RowSet
RowSet outRowSet = (RowSet)outputSet.getRowSets().get(0);
Constructor Summary |
RankTransformation()
Default constructor |
RankTransformation(java.lang.String name,
java.lang.String busName,
java.lang.String desc,
java.lang.String instName)
Initialize the object with name, business name, description and instance
name |
RankTransformation(java.lang.String name,
java.lang.String busName,
java.lang.String desc,
java.lang.String instName,
Mapping mapping,
InputSet vInputSets,
int rank,
java.lang.String rankPort,
java.lang.String[] groupBy,
boolean top,
java.util.Vector vTransformFields,
TransformationProperties props)
Constructor for Rank Transformation |
Methods inherited from class com.informatica.powercenter.sdk.mapfwk.core.Transformation |
add, addInitProp, defaultDuplicateNameRemovalSchema, genOutputSet, getGroupSet, getInitProps, getMapping, getOutFields, getOutputSet, getProperties, getSessionTransformInstanceKeySet, getSessionTransformInstanceProperty, getTemplateID, getTemplateName, getTransContext, getTransformationFieldAttr, getTransformationType, getTransformGroup, setGroupSet, setGroupSet, setMapping, setOutFields, setOutputSet, setReusable, setSessionTransformInstanceProperty, setTemplateIDAndName, setTransContext, setTransformationFieldAttr, setTransformationType, setTransformGroup, standardizeString |
Methods inherited from class com.informatica.powercenter.sdk.mapfwk.core.Table |
addField, addMetaExtension, getBusinessName, getDescription, getField, getFields, getInstanceName, getMetaExtensions, getName, getReferencedField, isReadOnly, isReusable, removeField, removeMetaExtension, setBusinessName, setDescription, setFields, setInstanceName, setMetaExtensions, setMetaExtensionValue, setName, setReadOnly |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RankTransformation
public RankTransformation()
- Default constructor
RankTransformation
public RankTransformation(java.lang.String name,
java.lang.String busName,
java.lang.String desc,
java.lang.String instName)
- Initialize the object with name, business name, description and instance
name
- Parameters:
name
- name of the tablebusName
- business namedesc
- descriptioninstName
- instance name
RankTransformation
public RankTransformation(java.lang.String name,
java.lang.String busName,
java.lang.String desc,
java.lang.String instName,
Mapping mapping,
InputSet vInputSets,
int rank,
java.lang.String rankPort,
java.lang.String[] groupBy,
boolean top,
java.util.Vector vTransformFields,
TransformationProperties props)
throws InvalidTransformationException
- Constructor for Rank Transformation
- Parameters:
name
- busName
- desc
- instName
- mapping
- vInputSets
- rank
- rankPort
- groupBy
- top
- vTransformFields
- props
-
- Throws:
InvalidTransformationException
apply
public OutputSet apply()
throws InvalidTransformationException
- Apply the Rank Transformation. Here another port is created as RANKINDEX
which is the first port.After this we add the output fields created by
the user in the Input Set.
- Returns:
- OutputSet object
- Throws:
InvalidTransformationException
- exception