@Test public void testTimePredicateCondition() throws Exception { String res1 = postgresqlExtractor.getTimestampPredicateCondition("my_date", 12061992080809L, "ddMMyyyyhhmmss", ">"); assertEquals(res1, "my_date > '1992-06-12 08:08:09'"); }
@Override public String getTimestampPredicateCondition(String column, long value, String valueFormat, String operator) { log.debug("Getting timestamp predicate for Postgres"); String formattedvalue = Utils.toDateTimeFormat(Long.toString(value), valueFormat, POSTGRES_TIMESTAMP_FORMAT); return Utils.getCoalesceColumnNames(column) + " " + operator + " '" + formattedvalue + "'"; }
PostgresqlExtractor extends JdbcExtractor { @Override public String getTimestampPredicateCondition(String column, long value, String valueFormat, String operator) { log.debug("Getting timestamp predicate for Postgres"); String formattedvalue = Utils.toDateTimeFormat(Long.toString(value), valueFormat, POSTGRES_TIMESTAMP_FORMAT); return Utils.getCoalesceColumnNames(column) + " " + operator + " '" + formattedvalue + "'"; } }
PostgresqlExtractor extends JdbcExtractor { @Override public String getTimestampPredicateCondition(String column, long value, String valueFormat, String operator) { log.debug("Getting timestamp predicate for Postgres"); String formattedvalue = Utils.toDateTimeFormat(Long.toString(value), valueFormat, POSTGRES_TIMESTAMP_FORMAT); return Utils.getCoalesceColumnNames(column) + " " + operator + " '" + formattedvalue + "'"; } PostgresqlExtractor(WorkUnitState workUnitState); }
PostgresqlExtractor extends JdbcExtractor { @Override public String getTimestampPredicateCondition(String column, long value, String valueFormat, String operator) { log.debug("Getting timestamp predicate for Postgres"); String formattedvalue = Utils.toDateTimeFormat(Long.toString(value), valueFormat, POSTGRES_TIMESTAMP_FORMAT); return Utils.getCoalesceColumnNames(column) + " " + operator + " '" + formattedvalue + "'"; } PostgresqlExtractor(WorkUnitState workUnitState); @Override String getHourPredicateCondition(String column, long value, String valueFormat, String operator); @Override String getDatePredicateCondition(String column, long value, String valueFormat, String operator); @Override String getTimestampPredicateCondition(String column, long value, String valueFormat, String operator); @Override List<Command> getSchemaMetadata(String schema, String entity); @Override List<Command> getHighWatermarkMetadata(String schema, String entity, String watermarkColumn,
      List<Predicate> predicateList); @Override List<Command> getCountMetadata(String schema, String entity, WorkUnit workUnit, List<Predicate> predicateList); @Override List<Command> getDataMetadata(String schema, String entity, WorkUnit workUnit, List<Predicate> predicateList); @Override String getConnectionUrl(); @Override Map<String, String> getDataTypeMap(); @Override String getWatermarkSourceFormat(WatermarkType watermarkType); @Override long exractSampleRecordCountFromQuery(String query); @Override String removeSampleClauseFromQuery(String query); @Override String constructSampleClause(); @Override String getLeftDelimitedIdentifier(); @Override String getRightDelimitedIdentifier(); @Override Iterator<JsonElement> getRecordSetFromSourceApi(String schema, String entity, WorkUnit workUnit,
      List<Predicate> predicateList); }
PostgresqlExtractor extends JdbcExtractor { @Override public String getTimestampPredicateCondition(String column, long value, String valueFormat, String operator) { log.debug("Getting timestamp predicate for Postgres"); String formattedvalue = Utils.toDateTimeFormat(Long.toString(value), valueFormat, POSTGRES_TIMESTAMP_FORMAT); return Utils.getCoalesceColumnNames(column) + " " + operator + " '" + formattedvalue + "'"; } PostgresqlExtractor(WorkUnitState workUnitState); @Override String getHourPredicateCondition(String column, long value, String valueFormat, String operator); @Override String getDatePredicateCondition(String column, long value, String valueFormat, String operator); @Override String getTimestampPredicateCondition(String column, long value, String valueFormat, String operator); @Override List<Command> getSchemaMetadata(String schema, String entity); @Override List<Command> getHighWatermarkMetadata(String schema, String entity, String watermarkColumn,
      List<Predicate> predicateList); @Override List<Command> getCountMetadata(String schema, String entity, WorkUnit workUnit, List<Predicate> predicateList); @Override List<Command> getDataMetadata(String schema, String entity, WorkUnit workUnit, List<Predicate> predicateList); @Override String getConnectionUrl(); @Override Map<String, String> getDataTypeMap(); @Override String getWatermarkSourceFormat(WatermarkType watermarkType); @Override long exractSampleRecordCountFromQuery(String query); @Override String removeSampleClauseFromQuery(String query); @Override String constructSampleClause(); @Override String getLeftDelimitedIdentifier(); @Override String getRightDelimitedIdentifier(); @Override Iterator<JsonElement> getRecordSetFromSourceApi(String schema, String entity, WorkUnit workUnit,
      List<Predicate> predicateList);  }