/* * (non-Javadoc) * * @see org.talend.cwm.management.api.DbmsLanguage#extract(org.talend.dataquality.indicators.DateGrain, * java.lang.String) */ @Override protected String extract(DateGrain dateGrain, String colName) { return "DATE_PART" + surroundWith( '(', surroundWith('\'', dateGrain.getLiteral(), '\'') + "," + colName, ')'); //$NON-NLS-1$ //$NON-NLS-2$ }
/* * (non-Javadoc) * * @see org.talend.cwm.management.api.DbmsLanguage#extract(org.talend.dataquality.indicators.DateGrain, * java.lang.String) */ @Override protected String extract(DateGrain dateGrain, String colName) { String toNumberToChar = "TO_NUMBER(TO_CHAR("; // $NON-NLS-1$ switch (dateGrain.getValue()) { case DateGrain.DAY_VALUE: return toNumberToChar + colName + ", 'DD'))"; // $NON-NLS-1$ case DateGrain.WEEK_VALUE: return toNumberToChar + colName + ", 'IW'))"; // $NON-NLS-1$ case DateGrain.MONTH_VALUE: return toNumberToChar + colName + ",'MM'))"; // $NON-NLS-1$ case DateGrain.QUARTER_VALUE: return toNumberToChar + colName + ",'Q'))"; // $NON-NLS-1$ case DateGrain.YEAR_VALUE: return toNumberToChar + colName + ", 'YYYY'))"; // $NON-NLS-1$ default: return super.extract(dateGrain, colName); } }