use of org.apache.iceberg.expressions.UnboundPredicate in project iceberg by apache.
the class TestHiveIcebergFilterFactory method testBooleanType.
@Test
public void testBooleanType() {
SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();
SearchArgument arg = builder.startAnd().equals("boolean", PredicateLeaf.Type.BOOLEAN, true).end().build();
UnboundPredicate expected = Expressions.equal("boolean", true);
UnboundPredicate actual = (UnboundPredicate) HiveIcebergFilterFactory.generateFilterExpression(arg);
assertPredicatesMatch(expected, actual);
}
use of org.apache.iceberg.expressions.UnboundPredicate in project iceberg by apache.
the class TestHiveIcebergFilterFactory method testTimestampType.
@Test
public void testTimestampType() {
Literal<Long> timestampLiteral = Literal.of("2012-10-02T05:16:17.123456").to(Types.TimestampType.withoutZone());
long timestampMicros = timestampLiteral.value();
Timestamp ts = Timestamp.valueOf(DateTimeUtil.timestampFromMicros(timestampMicros));
SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();
SearchArgument arg = builder.startAnd().equals("timestamp", PredicateLeaf.Type.TIMESTAMP, ts).end().build();
UnboundPredicate expected = Expressions.equal("timestamp", timestampMicros);
UnboundPredicate actual = (UnboundPredicate) HiveIcebergFilterFactory.generateFilterExpression(arg);
assertPredicatesMatch(expected, actual);
}
Aggregations