use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_intervalYearMonth.
@Test
public void test_intervalYearMonth() {
RelDataType type = FACTORY.createSqlIntervalType(new SqlIntervalQualifier(YEAR, MONTH, SqlParserPos.ZERO));
RexLiteral literal = BUILDER.makeSearchArgumentLiteral(sarg(new BigDecimal(1), new BigDecimal(2)), type);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(new SqlYearMonthInterval(1), new SqlYearMonthInterval(2)));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_smallint.
@Test
public void test_smallint() {
RexLiteral literal = literal(new BigDecimal(1), new BigDecimal(2), SqlTypeName.SMALLINT);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range((short) 1, (short) 2));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_intervalDaySecond.
@Test
public void test_intervalDaySecond() {
RelDataType type = FACTORY.createSqlIntervalType(new SqlIntervalQualifier(DAY, SECOND, SqlParserPos.ZERO));
RexLiteral literal = BUILDER.makeSearchArgumentLiteral(sarg(new BigDecimal(1), new BigDecimal(2)), type);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(new SqlDaySecondInterval(1), new SqlDaySecondInterval(2)));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_boolean.
@Test
public void test_boolean() {
RexLiteral literal = literal(false, true, SqlTypeName.BOOLEAN);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(false, true));
}
use of org.apache.calcite.rex.RexLiteral in project hazelcast by hazelcast.
the class RexToExpressionTest method test_timestamp.
@Test
public void test_timestamp() {
RexLiteral literal = literal(new TimestampString("2021-09-17 12:23:34"), new TimestampString("2021-09-17 12:23:35"), SqlTypeName.TIMESTAMP);
Range<?> converted = convert(literal);
assertThat(converted).isEqualToComparingFieldByField(range(LocalDateTime.of(2021, 9, 17, 12, 23, 34), LocalDateTime.of(2021, 9, 17, 12, 23, 35)));
}
Aggregations