Table of Contents

Search

  1. Preface
  2. Introduction to Transformations
  3. Transformation Ports
  4. Transformation Caches
  5. Address Validator Transformation
  6. Aggregator Transformation
  7. Association Transformation
  8. Bad Record Exception Transformation
  9. Case Converter Transformation
  10. Classifier Transformation
  11. Comparison Transformation
  12. Consolidation Transformation
  13. Data Masking Transformation
  14. Data Processor Transformation
  15. Decision Transformation
  16. Duplicate Record Exception Transformation
  17. Expression Transformation
  18. Filter Transformation
  19. Hierarchical to Relational Transformation
  20. Java Transformation
  21. Java Transformation API Reference
  22. Java Expressions
  23. Joiner Transformation
  24. Key Generator Transformation
  25. Labeler Transformation
  26. Lookup Transformation
  27. Lookup Caches
  28. Dynamic Lookup Cache
  29. Match Transformation
  30. Match Transformations in Field Analysis
  31. Match Transformations in Identity Analysis
  32. Normalizer Transformation
  33. Merge Transformation
  34. Parser Transformation
  35. Python Transformation
  36. Rank Transformation
  37. Read Transformation
  38. Relational to Hierarchical Transformation
  39. REST Web Service Consumer Transformation
  40. Router Transformation
  41. Sequence Generator Transformation
  42. Sorter Transformation
  43. SQL Transformation
  44. Standardizer Transformation
  45. Union Transformation
  46. Update Strategy Transformation
  47. Web Service Consumer Transformation
  48. Parsing Web Service SOAP Messages
  49. Generating Web Service SOAP Messages
  50. Weighted Average Transformation
  51. Window Transformation
  52. Write Transformation
  53. Appendix A: Transformation Delimiters

Developer Transformation Guide

Developer Transformation Guide

Early Selection Optimization with the Java Transformation

Early Selection Optimization with the Java Transformation

You can enable an active or passive Java transformation for early selection optimization if the Java transformation has no side effects. The optimizer passes the filter logic through the Java transformation and modifies the filter condition as required.
To view the code snippets for early selection optimization, choose PredicatePushOptimization in the navigator of the
Optimizer Interfaces
tab.

allowPredicatePush

Boolean. Enables early selection. Change the function to return a true result and message in order to enable early selection. Default is false, and the function returns a message that optimization is not supported.
public ResultAndMessage allowPredicatePush(boolean ignoreOrderOfOp) { // To Enable PredicatePushOptimization, this function should return true //return new ResultAndMessage(true, ""); return new ResultAndMessage(false, "Predicate Push Optimization Is Not Supported"); }

canGenerateOutputFieldEvalError

Boolean. Indicates whether or not the Java transformation can return an output field error, such as a division by zero error. Change the function to return false if the Java transformation does not generate output field errors. When the Java transformation can generate field errors, then the Data Integration Service cannot use early selection optimization.
public boolean canGenerateOutputFieldEvalError() { // If this Java transformation can never generate an output field evaluation error, // return false. return true; }

getInputExpr

Returns an Informatica expression that describes which input values from input fields comprise an output field. The optimizer needs to know which input fields comprise an output field in order to push the filter logic through the transformation.
public InfaExpression getInputExpr(TransformationField field, TransformationDataInterface group) { // This should return an Informatica expression for output fields in terms of input fields // We will only push predicate that use fields for which input expressions are defined. // For example, if you have two input fields in0 and in1 and three output fields out0, out1, out2 // out0 is the pass-through of in1, out2 is sum of in1 and in2, and out3 is unknown, the code should be: //if (field.getName().equals("out0")) // return new InfaExpression("in0", instance); //else if (field.getName().equals("out1")) // return new InfaExpression("in0 + in1", instance); //else if (field.getName().equals("out2")) // return null; return null; }
For example, a mapping contains a filter expression,
"out0 > 8
". Out0 is the value of the out0 output port in the Java transformation. You can define the value of out0 as the value of the in0 input port + 5. The optimizer can push the following expression
"(in0 + 5) > 8"
past the Java transformation with early selection optimization. You can return NULL if an output field does not have input field expression. The optimizer does not push filter expressions past output fields with no input expression.
You might include the following code:
if (field.getName().equals("out0")) return new InfaExpression("in0 + 5", instance); else if (field.getName().equals("out2")) return null;

inputGroupsPushPredicateTo

Returns a list of groups that can receive the filter logic. The Java transformation has one input group. Do not modify this function for the Java transformation.
public List<TransformationDataInterface> inputGroupsPushPredicateTo( List<TransformationField> fields) { // This functions returns a list of input data interfaces to push predicates to. // Since JavaTx only has one input data interface, you should not have to modify this function AbstractTransformation tx = instance.getTransformation(); List<DataInterface> dis = tx.getDataInterfaces(); List<TransformationDataInterface> inputDIs = new ArrayList<TransformationDataInterface>(); for (DataInterface di : dis){ TransformationDataInterface tdi = (TransformationDataInterface) di; if (tdi.isInput()) inputDIs.add(tdi); } if(inputDIs.size() == 1) return inputDIs; else return null; }

0 COMMENTS

We’d like to hear from you!