use of org.talend.dataquality.indicators.columnset.SimpleStatIndicator in project tdq-studio-se by Talend.
the class ColumnSetAnalysisDetailsPage method refreshIndicatorsSection.
/**
* refresh the Indicators Section.
*/
public void refreshIndicatorsSection() {
// when there have pattern, show allmatchindicator
ModelElementIndicator[] modelElementIndicator = treeViewer.getModelElementIndicator();
if (modelElementIndicator != null) {
for (ModelElementIndicator modelElementInd : modelElementIndicator) {
Indicator[] inds = modelElementInd.getPatternIndicators();
for (Indicator ind : inds) {
if (ind instanceof RegexpMatchingIndicator) {
indicatorsViewer.setInput(simpleStatIndicator, allMatchIndicator);
return;
}
}
}
}
indicatorsViewer.setInput(simpleStatIndicator);
}
use of org.talend.dataquality.indicators.columnset.SimpleStatIndicator in project tdq-studio-se by Talend.
the class ColumnSetAnalysisDetailsPage method recomputeIndicators.
public void recomputeIndicators() {
columnSetAnalysisHandler = new ColumnSetAnalysisHandler();
columnSetAnalysisHandler.setAnalysis(getCurrentModelElement());
stringDataFilter = columnSetAnalysisHandler.getStringDataFilter();
analyzedColumns = columnSetAnalysisHandler.getAnalyzedColumns();
if (columnSetAnalysisHandler.getSimpleStatIndicator() == null || columnSetAnalysisHandler.getSimpleStatIndicator().eIsProxy()) {
ColumnsetFactory columnsetFactory = ColumnsetFactory.eINSTANCE;
simpleStatIndicator = columnsetFactory.createSimpleStatIndicator();
simpleStatIndicator.setRowCountIndicator(IndicatorsFactory.eINSTANCE.createRowCountIndicator());
simpleStatIndicator.setDistinctCountIndicator(IndicatorsFactory.eINSTANCE.createDistinctCountIndicator());
simpleStatIndicator.setDuplicateCountIndicator(IndicatorsFactory.eINSTANCE.createDuplicateCountIndicator());
simpleStatIndicator.setUniqueCountIndicator(IndicatorsFactory.eINSTANCE.createUniqueCountIndicator());
} else {
simpleStatIndicator = (SimpleStatIndicator) columnSetAnalysisHandler.getSimpleStatIndicator();
}
if (columnSetAnalysisHandler.getAllmatchIndicator() == null) {
ColumnsetFactory columnsetFactory = ColumnsetFactory.eINSTANCE;
allMatchIndicator = columnsetFactory.createAllMatchIndicator();
DefinitionHandler.getInstance().setDefaultIndicatorDefinition(allMatchIndicator);
} else {
allMatchIndicator = (AllMatchIndicator) columnSetAnalysisHandler.getAllmatchIndicator();
}
initializeIndicator(simpleStatIndicator);
List<ModelElementIndicator> meIndicatorList = new ArrayList<ModelElementIndicator>();
ModelElementIndicator currentIndicator = null;
for (ModelElement element : analyzedColumns) {
// MOD yyi 2011-02-16 17871:delimitefile
MetadataColumn mdColumn = SwitchHelpers.METADATA_COLUMN_SWITCH.doSwitch(element);
TdColumn tdColumn = SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
if (tdColumn == null && mdColumn == null) {
continue;
}
if (tdColumn == null && mdColumn != null) {
currentIndicator = ModelElementIndicatorHelper.createDFColumnIndicator(RepositoryNodeHelper.recursiveFind(mdColumn));
} else if (tdColumn != null) {
RepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(tdColumn);
if (recursiveFind == null) {
recursiveFind = RepositoryNodeHelper.createRepositoryNode(tdColumn);
}
currentIndicator = ModelElementIndicatorHelper.createModelElementIndicator(recursiveFind);
}
DataminingType dataminingType = MetadataHelper.getDataminingType(element);
MetadataHelper.setDataminingType(dataminingType == null ? DataminingType.NOMINAL : dataminingType, element);
Collection<Indicator> indicatorList = columnSetAnalysisHandler.getRegexMathingIndicators(element);
if (null != currentIndicator) {
currentIndicator.setIndicators(indicatorList.toArray(new Indicator[indicatorList.size()]));
meIndicatorList.add(currentIndicator);
}
}
currentModelElementIndicators = meIndicatorList.toArray(new ModelElementIndicator[meIndicatorList.size()]);
}
use of org.talend.dataquality.indicators.columnset.SimpleStatIndicator in project tdq-studio-se by Talend.
the class IndicatorsComp method setInput.
// input composite indicator
public void setInput(Object... obj) {
List<ColumnSetIndicatorUnit> indicatortList = new ArrayList<ColumnSetIndicatorUnit>();
for (Object indicatorObj : obj) {
// for SimpleStatIndicator, CountAvgNullIndicator, MinMaxDateIndicator, WeakCorrelationIndicator
if (indicatorObj instanceof SimpleStatIndicator || indicatorObj instanceof CountAvgNullIndicator || indicatorObj instanceof MinMaxDateIndicator || indicatorObj instanceof WeakCorrelationIndicator) {
columnSetIndicator = (ColumnSetMultiValueIndicator) indicatorObj;
for (Indicator indicator : IndicatorHelper.getIndicatorLeavesBySingleNode(columnSetIndicator)) {
IndicatorEnum indicatorEnum = IndicatorEnum.findIndicatorEnum(indicator.eClass());
indicatortList.add(new ColumnSetIndicatorUnit(indicatorEnum, indicator));
}
// MOD msjian TDQ-8860: we always show the allMatchIndicator in the Indicators section
} else if (indicatorObj instanceof AllMatchIndicator) {
// for AllMatchIndicator
AllMatchIndicator allMatchIndicator = (AllMatchIndicator) indicatorObj;
indicatortList.add(new ColumnSetIndicatorUnit(IndicatorEnum.AllMatchIndicatorEnum, allMatchIndicator));
// TDQ-8860~
}
// ~
}
setElements(indicatortList.toArray(new ColumnSetIndicatorUnit[indicatortList.size()]));
}
use of org.talend.dataquality.indicators.columnset.SimpleStatIndicator in project tdq-studio-se by Talend.
the class DrillDownEditorInput method getColumnSetIndicatorResultSize.
/**
* DOC talend Comment method "getColumnSetIndicatorResultSize".
*
* @param itemsSize
* @return
*/
private Long getColumnSetIndicatorResultSize() {
Long itemsSize = 0l;
SimpleStatIndicator simpleStatIndicator = null;
// Find simpleStatIndicator from result of analysis
for (Indicator indicator : analysis.getResults().getIndicators()) {
if (SimpleStatIndicator.class.isInstance(indicator)) {
simpleStatIndicator = (SimpleStatIndicator) indicator;
break;
}
}
// Get the Result from simpleStatIndicator by currIndicator
if (simpleStatIndicator != null) {
if (DuplicateCountIndicator.class.isInstance(currIndicator)) {
itemsSize = simpleStatIndicator.getDuplicateCount();
} else if (DistinctCountIndicator.class.isInstance(currIndicator)) {
itemsSize = simpleStatIndicator.getDistinctCount();
} else if (UniqueCountIndicator.class.isInstance(currIndicator)) {
itemsSize = simpleStatIndicator.getUniqueCount();
} else if (RowCountIndicator.class.isInstance(currIndicator)) {
itemsSize = simpleStatIndicator.getCount();
}
}
return itemsSize;
}
use of org.talend.dataquality.indicators.columnset.SimpleStatIndicator in project tdq-studio-se by Talend.
the class DrillDownEditorInput method getDesignatedData.
/**
* DOC zshen Comment method "getDesignatedData".
*
* @return make column mapping with data
*/
private List<Object[]> getDesignatedData(List<Object[]> dataList) {
ModelElement analysisElement = currIndicator.getAnalyzedElement();
List<Object[]> returnDataList = new ArrayList<Object[]>();
if (dataList == null || dataList.size() < 0) {
return returnDataList;
}
if (DrillDownUtils.judgeMenuType(this.getMenuType(), DrillDownUtils.MENU_VALUE_TYPE)) {
int offset = 0;
// MOD qiongli 2011-3-3 feature 19192 drill down for columnSet with jave engine.
if (analysisElement == null && currIndicator.eContainer() instanceof SimpleStatIndicator) {
returnDataList = dataList;
} else {
if (analysisElement instanceof MetadataColumn) {
MetadataTable mTable = ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn) analysisElement);
List<MetadataColumn> columnElementList = mTable.getColumns();
offset = columnElementList.indexOf(analysisElement);
}
// Added yyin 20120608 TDQ-3589
if (currIndicator instanceof DuplicateCountIndicator) {
for (Object obj : ((DuplicateCountIndicator) currIndicator).getDuplicateValues()) {
Object[] newObj = new Object[1];
newObj[0] = obj;
returnDataList.add(newObj);
}
return returnDataList;
}
// ~
for (Object[] obj : dataList) {
Object[] newObj = new Object[1];
newObj[0] = obj[offset];
returnDataList.add(newObj);
}
}
} else {
returnDataList = dataList;
}
return returnDataList;
}
Aggregations