use of org.talend.dq.indicators.DelimitedFileIndicatorEvaluator in project tdq-studio-se by Talend.
the class DelimitedFileAnalysisExecutor method runAnalysis.
/*
* (non-Javadoc)
*
* @see org.talend.dq.analysis.AnalysisExecutor#runAnalysis(org.talend.dataquality.analysis.Analysis,
* java.lang.String)
*/
@Override
protected boolean runAnalysis(Analysis analysis, String sqlStatement) {
DelimitedFileIndicatorEvaluator eval = createIndicatorEvaluator(analysis);
DelimitedFileConnection con = (DelimitedFileConnection) analysis.getContext().getConnection();
EList<Indicator> indicators = analysis.getResults().getIndicators();
eval.setMonitor(getMonitor());
RowCountIndicatorsAdapter.getInstance().clear();
for (Indicator indicator : indicators) {
assert indicator != null;
MetadataColumn mColumn = SwitchHelpers.METADATA_COLUMN_SWITCH.doSwitch(indicator.getAnalyzedElement());
if (mColumn == null) {
continue;
}
String columnName = mColumn.getLabel();
eval.storeIndicator(columnName, indicator);
}
eval.setDelimitedFileconnection(con);
ReturnCode rc = eval.evaluateIndicators(sqlStatement, true);
if (!rc.isOk()) {
log.warn(rc.getMessage());
setError(rc.getMessage());
}
if (getMonitor() != null) {
getMonitor().worked(compIndicatorsWorked);
}
return rc.isOk();
}
Aggregations