use of org.talend.dataquality.record.linkage.genkey.BlockingKeyHandler in project tdq-studio-se by Talend.
the class BlockingKeySection method refreshChart.
/*
* (non-Javadoc)
*
* @see org.talend.dataquality.record.linkage.ui.section.AbstractMatchTableSection#RefreshChart()
*/
@Override
public void refreshChart() {
if (getBlockKeyDefinitionList().size() <= 0) {
MessageDialogWithToggle.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString("BlockingKeySection.RefreshChartError"), // $NON-NLS-1$ //$NON-NLS-2$
DefaultMessagesImpl.getString("BlockingKeySection.NoBlockKey"));
return;
}
ReturnCode checkResultStatus = checkResultStatus();
if (!checkResultStatus.isOk()) {
if (checkResultStatus.getMessage() != null && !checkResultStatus.getMessage().equals(StringUtils.EMPTY)) {
MessageDialogWithToggle.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString("BlockingKeySection.RefreshChartError"), // $NON-NLS-1$
checkResultStatus.getMessage());
}
return;
}
listeners.firePropertyChange(MatchAnalysisConstant.NEED_REFRESH_DATA, true, false);
BlockingKeyHandler executeGenerateBlockingAction = computeResult();
if (executeGenerateBlockingAction.getResultDataList().size() == 0) {
return;
}
blockingKeyDataChart.refresh(executeGenerateBlockingAction.getResultDatas());
MatchRuleAnlaysisUtils.refreshDataTable(analysis, executeGenerateBlockingAction.getResultDataList());
executeGenerateBlockingAction.getResultDatas().clear();
}
use of org.talend.dataquality.record.linkage.genkey.BlockingKeyHandler in project tdq-studio-se by Talend.
the class ExecuteMatchRuleHandler method computeBlockingKey.
private Map<String, List<String[]>> computeBlockingKey(Map<MetadataColumn, String> columnMap, List<Object[]> matchRows, RecordMatchingIndicator recordMatchingIndicator) {
List<Map<String, String>> blockKeySchema = AnalysisRecordGroupingUtils.getBlockKeySchema(recordMatchingIndicator);
for (MetadataColumn metaCol : columnMap.keySet()) {
if (metaCol.getName() == null) {
colName2IndexMap.put(metaCol.getLabel(), columnMap.get(metaCol));
} else {
colName2IndexMap.put(metaCol.getName(), columnMap.get(metaCol));
}
}
BlockingKeyHandler blockKeyHandler = new BlockingKeyHandler(blockKeySchema, colName2IndexMap);
blockKeyHandler.setInputData(matchRows);
// Added TDQ-14276: need to add the column date pattern map (for most recent/ancient function)
Map<String, String> patternMap = AnalysisRecordGroupingUtils.createColumnDatePatternMap(columnMap, colName2IndexMap);
blockKeyHandler.setColumnDatePatternMap(patternMap);
blockKeyHandler.run();
Map<String, List<String[]>> resultData = blockKeyHandler.getResultDatas();
return resultData;
}
use of org.talend.dataquality.record.linkage.genkey.BlockingKeyHandler in project tdq-studio-se by Talend.
the class BlockingKeySection method computeResult.
/**
* DOC zshen Comment method "computeRusult". <br>
* TODO Handle the return value: return the result directly instead of action instance.
*
* @return
*/
protected BlockingKeyHandler computeResult() {
List<Map<String, String>> blockingKeyData = MatchRuleAnlaysisUtils.blockingKeyDataConvert((List<KeyDefinition>) tableComposite.getInput());
Map<String, String> colName2IndexMap = new HashMap<String, String>();
for (MetadataColumn metaCol : columnMap.keySet()) {
colName2IndexMap.put(metaCol.getName(), columnMap.get(metaCol));
}
BlockingKeyHandler executeGenerateBlockingAction = new BlockingKeyHandler(blockingKeyData, colName2IndexMap);
if (hasBlockingKey()) {
executeGenerateBlockingAction.setInputData(matchRows);
executeGenerateBlockingAction.run();
}
return executeGenerateBlockingAction;
}
Aggregations