@Test public void testLeftBounded() { DatePartition partition = new DatePartition(COL_RAW, LocalDate.parse("2000-01-01"), null); String constraint = partition.toSqlConstraint(QUOTE, dbProduct); assertEquals( COL + " >= date'2000-01-01'", constraint ); }
@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct) { if (quoteString == null) { throw new RuntimeException("Quote string cannot be null"); } if (dbProduct == null) { throw new RuntimeException(String.format( "DbProduct cannot be null for partitions of type '%s'", PartitionType.DATE )); } return generateRangeConstraint( quoteString + column + quoteString, Stream.of(boundaries).map(b -> b == null ? null : dbProduct.wrapDate(b)).toArray(String[]::new) ); }
DatePartition extends BasePartition implements JdbcFragmentMetadata { @Override public String toSqlConstraint(String quoteString, DbProduct dbProduct) { if (quoteString == null) { throw new RuntimeException("Quote string cannot be null"); } if (dbProduct == null) { throw new RuntimeException(String.format( "DbProduct cannot be null for partitions of type '%s'", PartitionType.DATE )); } return generateRangeConstraint( quoteString + column + quoteString, Stream.of(boundaries).map(b -> b == null ? null : dbProduct.wrapDate(b)).toArray(String[]::new) ); } }
DatePartition extends BasePartition implements JdbcFragmentMetadata { @Override public String toSqlConstraint(String quoteString, DbProduct dbProduct) { if (quoteString == null) { throw new RuntimeException("Quote string cannot be null"); } if (dbProduct == null) { throw new RuntimeException(String.format( "DbProduct cannot be null for partitions of type '%s'", PartitionType.DATE )); } return generateRangeConstraint( quoteString + column + quoteString, Stream.of(boundaries).map(b -> b == null ? null : dbProduct.wrapDate(b)).toArray(String[]::new) ); } DatePartition(String column, LocalDate start, LocalDate end); }
DatePartition extends BasePartition implements JdbcFragmentMetadata { @Override public String toSqlConstraint(String quoteString, DbProduct dbProduct) { if (quoteString == null) { throw new RuntimeException("Quote string cannot be null"); } if (dbProduct == null) { throw new RuntimeException(String.format( "DbProduct cannot be null for partitions of type '%s'", PartitionType.DATE )); } return generateRangeConstraint( quoteString + column + quoteString, Stream.of(boundaries).map(b -> b == null ? null : dbProduct.wrapDate(b)).toArray(String[]::new) ); } DatePartition(String column, LocalDate start, LocalDate end); @Override String toSqlConstraint(String quoteString, DbProduct dbProduct); Date[] getBoundaries(); }
DatePartition extends BasePartition implements JdbcFragmentMetadata { @Override public String toSqlConstraint(String quoteString, DbProduct dbProduct) { if (quoteString == null) { throw new RuntimeException("Quote string cannot be null"); } if (dbProduct == null) { throw new RuntimeException(String.format( "DbProduct cannot be null for partitions of type '%s'", PartitionType.DATE )); } return generateRangeConstraint( quoteString + column + quoteString, Stream.of(boundaries).map(b -> b == null ? null : dbProduct.wrapDate(b)).toArray(String[]::new) ); } DatePartition(String column, LocalDate start, LocalDate end); @Override String toSqlConstraint(String quoteString, DbProduct dbProduct); Date[] getBoundaries();  }