Search in sources :

Example 1 with ColumnCorrelationAnalysisHandler

use of org.talend.dq.analysis.ColumnCorrelationAnalysisHandler in project tdq-studio-se by Talend.

the class CorrelationAnalysisDetailsPage method recomputeIndicators.

public void recomputeIndicators() {
    correlationAnalysisHandler = new ColumnCorrelationAnalysisHandler();
    correlationAnalysisHandler.setAnalysis(getCurrentModelElement());
    stringDataFilter = correlationAnalysisHandler.getStringDataFilter();
    analyzedColumns = correlationAnalysisHandler.getAnalyzedColumns();
    if (correlationAnalysisHandler.getIndicator() == null && columnSetMultiIndicator != null) {
        ColumnsetFactory columnsetFactory = ColumnsetFactory.eINSTANCE;
        // MOD qiongli 2010-6-18 bug 12766
        if (ColumnsetPackage.eINSTANCE.getCountAvgNullIndicator() == columnSetMultiIndicator.eClass()) {
            columnSetMultiIndicator = columnsetFactory.createCountAvgNullIndicator();
            // MOD xqliu 2010-04-06 bug 12161
            fillSimpleIndicators(columnSetMultiIndicator);
        // ~12161
        }
        if (ColumnsetPackage.eINSTANCE.getMinMaxDateIndicator() == columnSetMultiIndicator.eClass()) {
            columnSetMultiIndicator = columnsetFactory.createMinMaxDateIndicator();
        }
        if (ColumnsetPackage.eINSTANCE.getWeakCorrelationIndicator() == columnSetMultiIndicator.eClass()) {
            columnSetMultiIndicator = columnsetFactory.createWeakCorrelationIndicator();
        }
    } else {
        columnSetMultiIndicator = (ColumnSetMultiValueIndicator) correlationAnalysisHandler.getIndicator();
    }
    if (columnSetMultiIndicator == null) {
        columnSetMultiIndicator = ColumnsetFactory.eINSTANCE.createCountAvgNullIndicator();
    }
    initializeIndicator(columnSetMultiIndicator);
    columnSetMultiIndicator.setStoreData(true);
    for (ModelElement element : analyzedColumns) {
        TdColumn tdColumn = SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
        if (tdColumn == null) {
            continue;
        }
        // currentColumnIndicator = new ColumnIndicator(tdColumn);
        DataminingType dataminingType = correlationAnalysisHandler.getDatamingType(tdColumn);
        MetadataHelper.setDataminingType(dataminingType == null ? DataminingType.NOMINAL : dataminingType, tdColumn);
    }
}
Also used : ColumnCorrelationAnalysisHandler(org.talend.dq.analysis.ColumnCorrelationAnalysisHandler) DataminingType(org.talend.dataquality.indicators.DataminingType) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) TdColumn(org.talend.cwm.relational.TdColumn) ColumnsetFactory(org.talend.dataquality.indicators.columnset.ColumnsetFactory)

Aggregations

TdColumn (org.talend.cwm.relational.TdColumn)1 DataminingType (org.talend.dataquality.indicators.DataminingType)1 ColumnsetFactory (org.talend.dataquality.indicators.columnset.ColumnsetFactory)1 ColumnCorrelationAnalysisHandler (org.talend.dq.analysis.ColumnCorrelationAnalysisHandler)1 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)1