Search in sources :

Example 1 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class CorrelationAnalysisDetailsPage method initializeIndicator.

private void initializeIndicator(Indicator indicator) {
    if (indicator.getIndicatorDefinition() == null) {
        DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
    }
    // MOD xqliu 2010-04-06 bug 12161
    if (indicator instanceof CountAvgNullIndicator) {
        if (((CountAvgNullIndicator) indicator).getChildIndicators().size() == 0) {
            CountAvgNullIndicator countAvgNullIndicator = (CountAvgNullIndicator) indicator;
            fillSimpleIndicators(countAvgNullIndicator);
        }
        for (Indicator child : ((CompositeIndicator) indicator).getChildIndicators()) {
            // recurse
            initializeIndicator(child);
        }
    } else if (indicator instanceof CompositeIndicator) {
        // MOD qiongli 2012-5-14 TDQ-5256 should initialize children
        for (Indicator child : ((CompositeIndicator) indicator).getChildIndicators()) {
            initializeIndicator(child);
        }
    }
}
Also used : CompositeIndicator(org.talend.dataquality.indicators.CompositeIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) ColumnSetMultiValueIndicator(org.talend.dataquality.indicators.columnset.ColumnSetMultiValueIndicator) CountAvgNullIndicator(org.talend.dataquality.indicators.columnset.CountAvgNullIndicator) Indicator(org.talend.dataquality.indicators.Indicator) CompositeIndicator(org.talend.dataquality.indicators.CompositeIndicator)

Example 2 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class FunctionalDependencyAnalysisDetailsPage method getColumnSet.

private List<RepositoryNode> getColumnSet(EReference reference) {
    List<RepositoryNode> columns = new ArrayList<RepositoryNode>();
    EList<Indicator> indicators = getCurrentModelElement().getResults().getIndicators();
    for (Indicator indicator : indicators) {
        TdColumn findColumn = (TdColumn) indicator.eGet(reference);
        RepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(findColumn);
        if (recursiveFind == null) {
            recursiveFind = RepositoryNodeHelper.createRepositoryNode(findColumn);
        }
        if (recursiveFind != null) {
            columns.add(recursiveFind);
        }
    }
    return columns;
}
Also used : TdColumn(org.talend.cwm.relational.TdColumn) ArrayList(java.util.ArrayList) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) Indicator(org.talend.dataquality.indicators.Indicator) ColumnDependencyIndicator(org.talend.dataquality.indicators.columnset.ColumnDependencyIndicator)

Example 3 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class IndicatorPaginationInfo method createMenuForAllDataEntity.

/**
 * DOC yyin Comment method "createMenuForAllDataEntity".
 *
 * @param shell
 * @param dataExplorer
 * @param analysis
 * @param chartDataEntities
 * @return
 */
protected Map<String, Object> createMenuForAllDataEntity(Composite composite, DataExplorer dataExplorer, Analysis analysis, ChartDataEntity[] chartDataEntities) {
    Map<String, Object> menuMap = new HashMap<String, Object>();
    final ExecutionLanguage currentEngine = analysis.getParameters().getExecutionLanguage();
    // ADD msjian TDQ-7275 2013-5-21: when allow drill down is not checked, no menu display
    if (ExecutionLanguage.JAVA == currentEngine && !analysis.getParameters().isStoreData()) {
        return menuMap;
    }
    // TDQ-7275~
    for (ChartDataEntity oneDataEntity : chartDataEntities) {
        Indicator indicator = oneDataEntity.getIndicator();
        Menu menu = TOPChartUtils.getInstance().createMenu(composite, dataExplorer, analysis, oneDataEntity, indicator, false);
        ChartTableFactory.addJobGenerationMenu(menu, analysis, indicator);
        menuMap.put(oneDataEntity.getLabel(), menu);
    }
    return menuMap;
}
Also used : HashMap(java.util.HashMap) ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) Menu(org.eclipse.swt.widgets.Menu) Indicator(org.talend.dataquality.indicators.Indicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator)

Example 4 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class FunctionalDependencyAnalysisResultPage method initCustomerDataset.

/**
 * DOC xqliu Comment method "initCustomerDataset".
 *
 * @return
 */
private CustomerDefaultCategoryDataset initCustomerDataset() {
    CustomerDefaultCategoryDataset dataset = new CustomerDefaultCategoryDataset();
    Analysis analysis = this.getAnalysisHandler().getAnalysis();
    for (Indicator indicator2 : analysis.getResults().getIndicators()) {
        ColumnDependencyIndicator indicator = (ColumnDependencyIndicator) indicator2;
        String label = ColumnDependencyHelper.getIndicatorName(indicator);
        if (getAnalysisHandler().getResultMetadata().getExecutionNumber() > 0) {
            Long matchCount = indicator.getDistinctACount() == null ? 0 : indicator.getDistinctACount();
            Long notMatchCount = indicator.getACount() == null ? 0 : indicator.getACount() - matchCount;
            // $NON-NLS-1$
            dataset.addValue(matchCount, DefaultMessagesImpl.getString("ColumnDependencyResultPage.Match"), label);
            // $NON-NLS-1$
            dataset.addValue(notMatchCount, DefaultMessagesImpl.getString("ColumnDependencyResultPage.NotMatch"), label);
            PatternChartDataEntity dataEntity = new PatternChartDataEntity();
            dataEntity.setLabel(label);
            dataEntity.setIndicator(indicator);
            dataEntity.setNumMatch(matchCount.toString());
            dataEntity.setNumNoMatch(notMatchCount.toString());
            dataset.addDataEntity(dataEntity);
        }
    }
    return dataset;
}
Also used : ColumnDependencyIndicator(org.talend.dataquality.indicators.columnset.ColumnDependencyIndicator) PatternChartDataEntity(org.talend.dq.indicators.preview.table.PatternChartDataEntity) Analysis(org.talend.dataquality.analysis.Analysis) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset) Indicator(org.talend.dataquality.indicators.Indicator) ColumnDependencyIndicator(org.talend.dataquality.indicators.columnset.ColumnDependencyIndicator)

Example 5 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class MasterPaginationInfo method createChart.

/**
 * DOC bZhou Comment method "createChart".
 *
 * @param comp
 * @param chartType
 * @param units
 */
private void createChart(Composite comp, EIndicatorChartType chartType, List<IndicatorUnit> units) {
    final IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(chartType, units);
    boolean isPattern = chartTypeState instanceof PatternStatisticsState;
    Object chart = null;
    try {
        // MOD TDQ-8787 20140722 yyin:(when first switch from master to result) if there is some dynamic event for
        // the
        // current indicator, use its dataset directly (TDQ-9241)
        IEventReceiver event = EventManager.getInstance().findRegisteredEvent(units.get(0).getIndicator(), EventEnum.DQ_DYMANIC_CHART, 0);
        if (event == null) {
            chart = chartTypeState.getChart();
        } else {
            chart = chartTypeState.getChart(((DynamicChartEventReceiver) event).getDataset());
        }
        if (chart == null) {
            return;
        }
        if (!isPattern) {
            // need not to decorate the chart of Pattern(Regex/Sql/UdiMatch)
            TOPChartUtils.getInstance().decorateChart(chart, false);
        } else {
            TOPChartUtils.getInstance().decoratePatternMatching(chart);
        }
        Object chartComp = TOPChartUtils.getInstance().createChartComposite(comp, SWT.NONE, chart, true);
        addListenerToChartComp(chartComp, chartTypeState);
        List<Indicator> indicators = getIndicators(units);
        if (isSQLMode) {
            // use the dynamic model for SQL mode only.
            DynamicIndicatorModel dyModel = AnalysisUtils.createDynamicModel(chartType, indicators, chart);
            if (EIndicatorChartType.SUMMARY_STATISTICS.equals(chartType)) {
                if (units.size() == SummaryStatisticsState.FULL_FLAG) {
                    indicators = getIndicatorsForTable(units, false);
                }
                dyModel.setSummaryIndicators(indicators);
            }
            this.dynamicList.add(dyModel);
            if (EIndicatorChartType.SUMMARY_STATISTICS.equals(chartType)) {
                // for summary indicators: need to record the chart composite, which is used for create BAW chart
                dyModel.setBawParentChartComp(chartComp);
            }
        }
    } catch (Error e) {
        // $NON-NLS-1$
        log.error(DefaultMessagesImpl.getString("IndicatorPaginationInfo.FailToCreateChart"), e);
    } catch (Exception exp) {
        // $NON-NLS-1$
        log.error(DefaultMessagesImpl.getString("IndicatorPaginationInfo.FailToCreateChart"), exp);
    }
}
Also used : IEventReceiver(org.talend.dataprofiler.core.ui.events.IEventReceiver) PatternStatisticsState(org.talend.dataprofiler.core.ui.editor.preview.model.states.pattern.PatternStatisticsState) DynamicChartEventReceiver(org.talend.dataprofiler.core.ui.events.DynamicChartEventReceiver) DynamicIndicatorModel(org.talend.dataprofiler.core.model.dynamic.DynamicIndicatorModel) Indicator(org.talend.dataquality.indicators.Indicator) CompositeIndicator(org.talend.dataprofiler.core.ui.editor.preview.CompositeIndicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) IChartTypeStates(org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)

Aggregations

Indicator (org.talend.dataquality.indicators.Indicator)178 ArrayList (java.util.ArrayList)58 RowCountIndicator (org.talend.dataquality.indicators.RowCountIndicator)40 CompositeIndicator (org.talend.dataquality.indicators.CompositeIndicator)31 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)31 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)28 Analysis (org.talend.dataquality.analysis.Analysis)27 DuplicateCountIndicator (org.talend.dataquality.indicators.DuplicateCountIndicator)27 UniqueCountIndicator (org.talend.dataquality.indicators.UniqueCountIndicator)27 AllMatchIndicator (org.talend.dataquality.indicators.columnset.AllMatchIndicator)26 ReturnCode (org.talend.utils.sugars.ReturnCode)25 SimpleStatIndicator (org.talend.dataquality.indicators.columnset.SimpleStatIndicator)24 UserDefIndicator (org.talend.dataquality.indicators.sql.UserDefIndicator)24 PatternMatchingIndicator (org.talend.dataquality.indicators.PatternMatchingIndicator)23 DistinctCountIndicator (org.talend.dataquality.indicators.DistinctCountIndicator)22 NullCountIndicator (org.talend.dataquality.indicators.NullCountIndicator)22 TdColumn (org.talend.cwm.relational.TdColumn)20 WhereRuleIndicator (org.talend.dataquality.indicators.sql.WhereRuleIndicator)18 FrequencyIndicator (org.talend.dataquality.indicators.FrequencyIndicator)17 Test (org.junit.Test)16