Search in sources :

Example 21 with BlockKeyDefinition

use of org.talend.dataquality.rules.BlockKeyDefinition in project tdq-studio-se by Talend.

the class MatchRuleAnlaysisUtils method blockingKeyDataConvert.

/**
 * DOC yyin Comment method "ruleMatcherConvert".
 *
 * @param blockKeyDef
 * @param columnMap
 * @return
 */
public static List<Map<String, String>> blockingKeyDataConvert(List<KeyDefinition> blockKeyDefList) {
    List<Map<String, String>> resultListData = new ArrayList<Map<String, String>>();
    for (KeyDefinition keyDef : blockKeyDefList) {
        BlockKeyDefinition blockKeydef = (BlockKeyDefinition) keyDef;
        String column = blockKeydef.getColumn();
        String preAlgo = blockKeydef.getPreAlgorithm().getAlgorithmType();
        String preAlgoValue = blockKeydef.getPreAlgorithm().getAlgorithmParameters();
        String algorithm = blockKeydef.getAlgorithm().getAlgorithmType();
        String algorithmValue = blockKeydef.getAlgorithm().getAlgorithmParameters();
        String postAlgo = blockKeydef.getPostAlgorithm().getAlgorithmType();
        String postAlgValue = blockKeydef.getPostAlgorithm().getAlgorithmParameters();
        Map<String, String> blockKeyDefMap = AnalysisRecordGroupingUtils.getBlockingKeyMap(column, preAlgo, preAlgoValue, algorithm, algorithmValue, postAlgo, postAlgValue);
        resultListData.add(blockKeyDefMap);
    }
    return resultListData;
}
Also used : ArrayList(java.util.ArrayList) BlockKeyDefinition(org.talend.dataquality.rules.BlockKeyDefinition) Map(java.util.Map) BlockKeyDefinition(org.talend.dataquality.rules.BlockKeyDefinition) KeyDefinition(org.talend.dataquality.rules.KeyDefinition) MatchKeyDefinition(org.talend.dataquality.rules.MatchKeyDefinition)

Aggregations

BlockKeyDefinition (org.talend.dataquality.rules.BlockKeyDefinition)21 ArrayList (java.util.ArrayList)11 RecordMatchingIndicator (org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)7 HashMap (java.util.HashMap)6 MatchKeyDefinition (org.talend.dataquality.rules.MatchKeyDefinition)6 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)5 AlgorithmDefinition (org.talend.dataquality.rules.AlgorithmDefinition)5 MatchRule (org.talend.dataquality.rules.MatchRule)5 KeyDefinition (org.talend.dataquality.rules.KeyDefinition)4 MatchRuleDefinition (org.talend.dataquality.rules.MatchRuleDefinition)4 Map (java.util.Map)3 ISelection (org.eclipse.jface.viewers.ISelection)3 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)3 Test (org.junit.Test)3 BlockKeyIndicator (org.talend.dataquality.indicators.columnset.BlockKeyIndicator)3 MatchGroupResultConsumer (org.talend.dataquality.record.linkage.grouping.MatchGroupResultConsumer)3 ExecuteMatchRuleHandler (org.talend.dq.analysis.match.ExecuteMatchRuleHandler)3 AppliedBlockKey (org.talend.dataquality.rules.AppliedBlockKey)2 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1