Search in sources :

Example 1 with SybaseASEDbmsLanguage

use of org.talend.dq.dbms.SybaseASEDbmsLanguage 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;
}
Also used : HiveDbmsLanguage(org.talend.dq.dbms.HiveDbmsLanguage) TdColumn(org.talend.cwm.relational.TdColumn) SybaseASEDbmsLanguage(org.talend.dq.dbms.SybaseASEDbmsLanguage) DB2DbmsLanguage(org.talend.dq.dbms.DB2DbmsLanguage)

Aggregations

TdColumn (org.talend.cwm.relational.TdColumn)1 DB2DbmsLanguage (org.talend.dq.dbms.DB2DbmsLanguage)1 HiveDbmsLanguage (org.talend.dq.dbms.HiveDbmsLanguage)1 SybaseASEDbmsLanguage (org.talend.dq.dbms.SybaseASEDbmsLanguage)1