Search in sources :

Example 6 with KeyDefinition

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

the class MatchingKeySection method getCurrentMatchKeyColumn.

/**
 * find the current columns which has been selected as match key on the current Tab(Match rule)
 *
 * @return
 */
public List<String> getCurrentMatchKeyColumn() {
    List<String> columnAsKey = new ArrayList<String>();
    MatchRule matchRule;
    try {
        matchRule = getCurrentMatchRule();
    } catch (Exception e) {
        return columnAsKey;
    }
    for (KeyDefinition keyDef : matchRule.getMatchKeys()) {
        columnAsKey.add(keyDef.getColumn());
    }
    return columnAsKey;
}
Also used : ArrayList(java.util.ArrayList) MatchRule(org.talend.dataquality.rules.MatchRule) MatchKeyDefinition(org.talend.dataquality.rules.MatchKeyDefinition) SurvivorshipKeyDefinition(org.talend.dataquality.rules.SurvivorshipKeyDefinition) KeyDefinition(org.talend.dataquality.rules.KeyDefinition)

Example 7 with KeyDefinition

use of org.talend.dataquality.rules.KeyDefinition 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

KeyDefinition (org.talend.dataquality.rules.KeyDefinition)7 BlockKeyDefinition (org.talend.dataquality.rules.BlockKeyDefinition)5 ArrayList (java.util.ArrayList)4 MatchKeyDefinition (org.talend.dataquality.rules.MatchKeyDefinition)4 Map (java.util.Map)3 HashMap (java.util.HashMap)2 RecordMatchingIndicator (org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)2 MatchRule (org.talend.dataquality.rules.MatchRule)2 SurvivorshipKeyDefinition (org.talend.dataquality.rules.SurvivorshipKeyDefinition)2 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)1 BlockingKeyHandler (org.talend.dataquality.record.linkage.genkey.BlockingKeyHandler)1 AppliedBlockKey (org.talend.dataquality.rules.AppliedBlockKey)1