use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_date.
@Test
public void test_date() {
RexLiteral literal = literal(new DateString("2021-09-17"), new DateString("2021-09-18"), SqlTypeName.DATE);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(LocalDate.of(2021, 9, 17), LocalDate.of(2021, 9, 18)));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_real.
@Test
public void test_real() {
RexLiteral literal = literal(new BigDecimal(1), new BigDecimal(2), SqlTypeName.REAL);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(1F, 2F));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_int.
@Test
public void test_int() {
RexLiteral literal = literal(new BigDecimal(1), new BigDecimal(2), SqlTypeName.INTEGER);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(1, 2));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_double.
@Test
public void test_double() {
RexLiteral literal = literal(new BigDecimal(1), new BigDecimal(2), SqlTypeName.DOUBLE);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(1D, 2D));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_decimal.
@Test
public void test_decimal() {
RexLiteral literal = literal(new BigDecimal(1), new BigDecimal(2), SqlTypeName.DECIMAL);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(new BigDecimal(1), new BigDecimal(2)));
}
Aggregations