use of org.talend.dataquality.indicators.columnset.RecordMatchingIndicator in project tdq-studio-se by Talend.
the class DuplicateRecordStatisticsSection method setDupRecordTableInput.
/**
* DOC zhao Comment method "setDupRecTableInput".
*/
private void setDupRecordTableInput() {
RecordMatchingIndicator recordMatchingIndicator = MatchRuleAnlaysisUtils.getRecordMatchIndicatorFromAna(analysis);
// Row count
Long rowCount = recordMatchingIndicator.getCount();
// Compute row count.
DuplicateStatisticsRow rowCountRow = new DuplicateStatisticsRow();
rowCountRow.setIsRowCount(Boolean.TRUE);
// $NON-NLS-1$
rowCountRow.setLabel(DefaultMessagesImpl.getString("DuplicateRecordStatisticsSection.ROW_COUNT"));
rowCountRow.setCount(rowCount);
setPercentage(rowCount, rowCount, rowCountRow);
// Unique records
DuplicateStatisticsRow uniqueRow = new DuplicateStatisticsRow();
// $NON-NLS-1$
uniqueRow.setLabel(DefaultMessagesImpl.getString("DuplicateRecordStatisticsSection.UNIQUE_RECORDS"));
Long uniqueCount = rowCount - recordMatchingIndicator.getSuspectRecordCount() - recordMatchingIndicator.getMatchedRecordCount();
uniqueRow.setCount(uniqueCount);
setPercentage(uniqueCount, rowCount, uniqueRow);
// Matched records.
DuplicateStatisticsRow matchedRow = new DuplicateStatisticsRow();
// $NON-NLS-1$
matchedRow.setLabel(DefaultMessagesImpl.getString("DuplicateRecordStatisticsSection.MATCHED_RECORDS"));
matchedRow.setCount(recordMatchingIndicator.getMatchedRecordCount());
setPercentage(recordMatchingIndicator.getMatchedRecordCount(), rowCount, matchedRow);
// Suspect records.
DuplicateStatisticsRow suspectRow = new DuplicateStatisticsRow();
// $NON-NLS-1$
suspectRow.setLabel(DefaultMessagesImpl.getString("DuplicateRecordStatisticsSection.SUSPECT_RECORDS"));
suspectRow.setCount(recordMatchingIndicator.getSuspectRecordCount());
setPercentage(recordMatchingIndicator.getSuspectRecordCount(), rowCount, suspectRow);
List<DuplicateStatisticsRow> duplStatsRowList = new ArrayList<DuplicateStatisticsRow>();
duplStatsRowList.add(rowCountRow);
duplStatsRowList.add(uniqueRow);
duplStatsRowList.add(matchedRow);
duplStatsRowList.add(suspectRow);
duplicateRecordTableViewer.setInput(duplStatsRowList);
}
use of org.talend.dataquality.indicators.columnset.RecordMatchingIndicator in project tdq-studio-se by Talend.
the class DuplicateRecordStatisticsSection method createSubContent.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.record.linkage.ui.section.AbstractMatchAnaysisTableSection#createSubContent(org.eclipse
* .swt.widgets.Composite)
*/
@Override
protected Composite createSubContent(Composite sectionClient) {
duplicateRecordTableViewer = new DuplicateRecordTableViewer(sectionClient, SWT.NONE);
setDupRecordTableInput();
// Add the merged records information: only for T-swoosh
final Object[] IndicatorList = MatchRuleAnlaysisUtils.getNeedIndicatorFromAna(analysis);
final RecordMatchingIndicator recordMatchingIndicator = (RecordMatchingIndicator) IndicatorList[0];
if (recordMatchingIndicator.getBuiltInMatchRuleDefinition().getRecordLinkageAlgorithm().equals(RecordMatcherType.T_SwooshAlgorithm.name())) {
Composite mergedRecordComp = new Composite(sectionClient, SWT.NONE);
mergedRecordComp.setLayout(new GridLayout(2, true));
Label mergedRcdLabel = new Label(mergedRecordComp, SWT.NONE);
// $NON-NLS-1$
mergedRcdLabel.setText(DefaultMessagesImpl.getString("DuplicateRecordStatisticsSection.MergedRecord"));
mergedRecordsValue = new Label(mergedRecordComp, SWT.NONE);
Long mergedRecordsCount = computeMergedRecords();
mergedRecordsValue.setText(mergedRecordsCount.toString());
}
return sectionClient;
}
Aggregations