Search in sources :

Example 1 with DuplicateStatisticsRow

use of org.talend.dataquality.record.linkage.ui.composite.tableviewer.provider.DuplicateStatisticsRow in project tdq-studio-se by Talend.

the class DuplicateRecordPieChart method getPieDataset.

private Object getPieDataset(List<DuplicateStatisticsRow> dupStats) {
    Map<String, Long> dupMap = new HashMap<String, Long>();
    for (DuplicateStatisticsRow dupStatRow : dupStats) {
        if (!dupStatRow.getIsRowCount()) {
            String label = dupStatRow.getLabel();
            dupMap.put(label, dupStatRow.getCount());
        }
    }
    return TOPChartUtil.getInstance().createDatasetForDuplicateRecord(dupMap);
}
Also used : DuplicateStatisticsRow(org.talend.dataquality.record.linkage.ui.composite.tableviewer.provider.DuplicateStatisticsRow) HashMap(java.util.HashMap)

Example 2 with DuplicateStatisticsRow

use of org.talend.dataquality.record.linkage.ui.composite.tableviewer.provider.DuplicateStatisticsRow 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 3 with DuplicateStatisticsRow

use of org.talend.dataquality.record.linkage.ui.composite.tableviewer.provider.DuplicateStatisticsRow in project tdq-studio-se by Talend.

the class DuplicateRecordStatisticsSection method createSubChart.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.dataquality.record.linkage.ui.section.AbstractMatchAnaysisTableSection#createSubChart(org.eclipse.
     * swt.widgets.Composite)
     */
@Override
protected void createSubChart(Composite sectionClient) {
    duplicateRecordPieChart = new DuplicateRecordPieChart(sectionClient);
    List<DuplicateStatisticsRow> dupStatistics = (List<DuplicateStatisticsRow>) duplicateRecordTableViewer.getInput();
    duplicateRecordPieChart.createPieChart(dupStatistics);
}
Also used : DuplicateRecordPieChart(org.talend.dataquality.record.linkage.ui.composite.chart.DuplicateRecordPieChart) DuplicateStatisticsRow(org.talend.dataquality.record.linkage.ui.composite.tableviewer.provider.DuplicateStatisticsRow) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

DuplicateStatisticsRow (org.talend.dataquality.record.linkage.ui.composite.tableviewer.provider.DuplicateStatisticsRow)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1 List (java.util.List)1 RecordMatchingIndicator (org.talend.dataquality.indicators.columnset.RecordMatchingIndicator)1 DuplicateRecordPieChart (org.talend.dataquality.record.linkage.ui.composite.chart.DuplicateRecordPieChart)1