use of org.talend.dq.dbms.DB2DbmsLanguage in project tdq-studio-se by Talend.
the class FunctionFrequencyStatExplorer method getInstantiatedClause.
@Override
protected String getInstantiatedClause() {
// get function which convert data into a pattern
String colName = columnName;
String function = null;
TdColumn column = (TdColumn) indicator.getAnalyzedElement();
int javaType = column.getSqlDataType().getJavaDataType();
if (!Java2SqlType.isNumbericInSQL(javaType)) {
function = getFunction();
} else {
colName = columnNameConvert();
}
// MOD mzhao bug 9681 2009-11-09
Object value = null;
if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof DB2DbmsLanguage) {
value = entity.getKey();
} else {
// $NON-NLS-1$//$NON-NLS-2$
value = "'" + entity.getKey() + "'";
}
String clause = entity.isLabelNull() ? columnName + dbmsLanguage.isNull() : ((function == null ? colName : function) + dbmsLanguage.equal() + value);
// ADD xqliu 2011-06-03 bug 20600's note 86482
if (dbmsLanguage instanceof InfomixDbmsLanguage) {
clause = clause.replaceAll(InfomixDbmsLanguage.AS_REPLACE_COLUMN, PluginConstant.EMPTY_STRING);
}
// ~ 20600
return clause;
}
use of org.talend.dq.dbms.DB2DbmsLanguage in project tdq-studio-se by Talend.
the class FrequencyStatisticsExplorer method getInstantiatedClause.
/**
* Method "getInstantiatedClause".
*
* @return the where clause from the instantiated query
*/
protected String getInstantiatedClause() {
// get function which convert data into a pattern
TdColumn column = (TdColumn) indicator.getAnalyzedElement();
int javaType = column.getSqlDataType().getJavaDataType();
// MOD mzhao bug 9681 2009-11-09
Object value = null;
if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof DB2DbmsLanguage) {
value = entity.getKey();
} else if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof SybaseASEDbmsLanguage) {
value = entity.getKey();
} else if (Java2SqlType.isNumbericInSQL(javaType) && dbmsLanguage instanceof HiveDbmsLanguage) {
value = entity.getKey();
} else {
// $NON-NLS-1$ //$NON-NLS-2$
value = "'" + entity.getKey() + "'";
}
String clause = entity.isLabelNull() ? columnName + dbmsLanguage.isNull() : columnName + dbmsLanguage.equal() + value;
return clause;
}
Aggregations