Search in sources :

Example 1 with AnalysisType

use of org.talend.dataquality.analysis.AnalysisType in project tdq-studio-se by Talend.

the class AnalysisCategoryItemProvider method getText.

/**
 * This returns the label text for the adapted class.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public String getText(Object object) {
    AnalysisType labelValue = ((AnalysisCategory) object).getAnalysisType();
    String label = labelValue == null ? null : labelValue.toString();
    return label == null || label.length() == 0 ? getString("_UI_AnalysisCategory_type") : getString("_UI_AnalysisCategory_type") + " " + label;
}
Also used : AnalysisType(org.talend.dataquality.analysis.AnalysisType) AnalysisCategory(org.talend.dataquality.analysis.category.AnalysisCategory)

Example 2 with AnalysisType

use of org.talend.dataquality.analysis.AnalysisType in project tdq-studio-se by Talend.

the class DrillDownEditorInput method isColumnSetIndicator.

/**
 * DOC talend Comment method "isColumnSetIndicator".
 *
 * @return
 */
private boolean isColumnSetIndicator() {
    Analysis analysis = this.getAnalysis();
    AnalysisType analysisType = analysis.getParameters().getAnalysisType();
    return AnalysisType.COLUMN_SET == analysisType;
}
Also used : AnalysisType(org.talend.dataquality.analysis.AnalysisType) Analysis(org.talend.dataquality.analysis.Analysis)

Example 3 with AnalysisType

use of org.talend.dataquality.analysis.AnalysisType in project tdq-studio-se by Talend.

the class DrillDownEditorInput method getDataSetForMapDB.

/**
 * DataSet is used to be the input on the export wizard. unchecked is for the type of mapDB else will have a warning
 *
 * @param controller
 * @return
 */
@SuppressWarnings("unchecked")
public Object getDataSetForMapDB(int pageSize) {
    List<String> columnElementList = filterAdaptColumnHeader();
    columnHeader = new String[columnElementList.size()];
    int headerIndex = 0;
    for (String columnElement : columnElementList) {
        columnHeader[headerIndex++] = columnElement;
    }
    AbstractDB<?> mapDB = getMapDB();
    if (mapDB == null) {
        return null;
    }
    AnalysisType analysisType = analysis.getParameters().getAnalysisType();
    if (AnalysisType.COLUMN_SET == analysisType) {
        Long size = getCurrentIndicatorResultSize();
        if (ColumnSetDBMap.class.isInstance(mapDB)) {
            return SqlExplorerUtils.getDefault().createMapDBColumnSetDataSet(columnHeader, (ColumnSetDBMap) mapDB, size, IDataValidationFactory.INSTANCE.createValidation(currIndicator), pageSize);
        }
    }
    if (DBSet.class.isInstance(mapDB)) {
        return SqlExplorerUtils.getDefault().createMapDBSetDataSet(columnHeader, (DBSet<Object>) mapDB, pageSize);
    } else {
        ColumnFilter columnFilter = getColumnFilter();
        Long itemSize = getItemSize(mapDB);
        return SqlExplorerUtils.getDefault().createMapDBDataSet(columnHeader, (DBMap<Object, List<Object>>) mapDB, pageSize, columnFilter, itemSize);
    }
}
Also used : AnalysisType(org.talend.dataquality.analysis.AnalysisType) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) List(java.util.List) ColumnFilter(org.talend.cwm.indicator.ColumnFilter)

Example 4 with AnalysisType

use of org.talend.dataquality.analysis.AnalysisType in project tdq-studio-se by Talend.

the class DrillDownUtils method getMapDB.

/**
 * Get MapDB which store the drill down data for current indicator
 *
 * @param analysis
 *
 * @return
 */
public static AbstractDB<Object> getMapDB(final ChartDataEntity dataEntity, Analysis analysis, MenuItemEntity itemEntitie) {
    AnalysisType analysisType = analysis.getParameters().getAnalysisType();
    if (AnalysisType.COLUMN_SET == analysisType) {
        return getColumnSetAnalysisMapDB(analysis);
    }
    Indicator indicator = dataEntity.getIndicator();
    String selectValue = dataEntity.getLabel();
    // TDQ-10785: fix the drill down menu for frequency table indicator and pattern frequency indicator can not use
    // when the data is too long
    String keyLabel = String.valueOf(dataEntity.getKey());
    // the equals on the right is the same to FrequencyTypeStateUtil.getKeyLabel()
    if (keyLabel.length() > 30 && selectValue.equals(keyLabel.substring(0, 30) + "...(" + keyLabel.length() + " characters)")) {
        // $NON-NLS-1$ //$NON-NLS-2$
        selectValue = keyLabel;
    }
    // TDQ-10785~
    String dbMapName = getDBMapName(analysisType, indicator, selectValue, itemEntitie);
    return MapDBUtils.getMapDB(dbMapName, dataEntity.getIndicator());
}
Also used : AnalysisType(org.talend.dataquality.analysis.AnalysisType) FrequencyIndicator(org.talend.dataquality.indicators.FrequencyIndicator) LengthIndicator(org.talend.dataquality.indicators.LengthIndicator) SimpleStatIndicator(org.talend.dataquality.indicators.columnset.SimpleStatIndicator) Indicator(org.talend.dataquality.indicators.Indicator)

Example 5 with AnalysisType

use of org.talend.dataquality.analysis.AnalysisType in project tdq-studio-se by Talend.

the class AnalysisExecutorSelector method getAnalysisExecutor.

/**
 * Method "getAnalysisExecutor".
 *
 * @param analysis the analysis to be run by the executor.
 * @return the appropriate executor of the analysis or null when no appropriate executor has been found.
 */
public static IAnalysisExecutor getAnalysisExecutor(Analysis analysis) {
    assert analysis != null;
    AnalysisType analysisType = AnalysisHelper.getAnalysisType(analysis);
    if (analysisType == null) {
        // $NON-NLS-1$
        log.error(Messages.getString("AnalysisExecutorSelector.ANALYSISTYPEISNOTSET", analysis.getName()));
        return null;
    }
    ExecutionLanguage executionEngine = AnalysisHelper.getExecutionEngine(analysis);
    IAnalysisExecutor exec = null;
    switch(analysisType) {
        case MULTIPLE_COLUMN:
            exec = getModelElementAnalysisExecutor(analysis, executionEngine);
            break;
        case CONNECTION:
            exec = new ConnectionAnalysisExecutor();
            break;
        case SCHEMA:
            exec = new SchemaAnalysisExecutor();
            break;
        case CATALOG:
            exec = new CatalogAnalysisExecutor();
            break;
        case COLUMNS_COMPARISON:
            exec = new RowMatchingAnalysisExecutor();
            break;
        case COLUMN_CORRELATION:
            exec = new MultiColumnAnalysisExecutor();
            break;
        case COLUMN_SET:
            // MOD yyi 2011-02-22 17871:delimitefile
            exec = getColumnSetAnalysisExecutor(analysis, executionEngine);
            break;
        case TABLE:
            exec = new TableAnalysisSqlExecutor();
            break;
        case TABLE_FUNCTIONAL_DEPENDENCY:
            exec = new FunctionalDependencyExecutor();
            break;
        case MATCH_ANALYSIS:
            exec = new MatchAnalysisExecutor();
            break;
        default:
            // this should not happen. This executor has not been tested for a long time.
            exec = null;
    }
    return exec;
}
Also used : AnalysisType(org.talend.dataquality.analysis.AnalysisType) ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage)

Aggregations

AnalysisType (org.talend.dataquality.analysis.AnalysisType)16 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)3 Indicator (org.talend.dataquality.indicators.Indicator)3 ColumnFilter (org.talend.cwm.indicator.ColumnFilter)2 OpeningHelpWizardDialog (org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog)2 Analysis (org.talend.dataquality.analysis.Analysis)2 AnalysisLabelParameter (org.talend.dq.analysis.parameters.AnalysisLabelParameter)2 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 WorkspaceJob (org.eclipse.core.resources.WorkspaceJob)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IJobChangeEvent (org.eclipse.core.runtime.jobs.IJobChangeEvent)1 JobChangeAdapter (org.eclipse.core.runtime.jobs.JobChangeAdapter)1 EObject (org.eclipse.emf.ecore.EObject)1 IContext (org.eclipse.help.IContext)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1