Search in sources :

Example 31 with RecordMatchingIndicator

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);
}
Also used : DuplicateStatisticsRow(org.talend.dataquality.record.linkage.ui.composite.tableviewer.provider.DuplicateStatisticsRow) ArrayList(java.util.ArrayList) RecordMatchingIndicator(org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)

Example 32 with RecordMatchingIndicator

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;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) DuplicateRecordTableViewer(org.talend.dataquality.record.linkage.ui.composite.tableviewer.DuplicateRecordTableViewer) Label(org.eclipse.swt.widgets.Label) RecordMatchingIndicator(org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)

Aggregations

RecordMatchingIndicator (org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)32 ArrayList (java.util.ArrayList)9 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)8 MatchRuleDefinition (org.talend.dataquality.rules.MatchRuleDefinition)8 BlockKeyIndicator (org.talend.dataquality.indicators.columnset.BlockKeyIndicator)7 MatchGroupResultConsumer (org.talend.dataquality.record.linkage.grouping.MatchGroupResultConsumer)7 BlockKeyDefinition (org.talend.dataquality.rules.BlockKeyDefinition)7 HashMap (java.util.HashMap)6 AlgorithmDefinition (org.talend.dataquality.rules.AlgorithmDefinition)6 MatchRule (org.talend.dataquality.rules.MatchRule)6 Test (org.junit.Test)5 Indicator (org.talend.dataquality.indicators.Indicator)5 MatchKeyDefinition (org.talend.dataquality.rules.MatchKeyDefinition)5 ExecuteMatchRuleHandler (org.talend.dq.analysis.match.ExecuteMatchRuleHandler)5 ReturnCode (org.talend.utils.sugars.ReturnCode)3 TypedReturnCode (org.talend.utils.sugars.TypedReturnCode)3 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Analysis (org.talend.dataquality.analysis.Analysis)2 KeyDefinition (org.talend.dataquality.rules.KeyDefinition)2