use of org.apache.iceberg.expressions.UnboundPredicate in project iceberg by apache.
the class TestHiveIcebergFilterFactory method testEqualsOperand.
@Test
public void testEqualsOperand() {
SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();
SearchArgument arg = builder.startAnd().equals("salary", PredicateLeaf.Type.LONG, 3000L).end().build();
UnboundPredicate expected = Expressions.equal("salary", 3000L);
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 testInOperand.
@Test
public void testInOperand() {
SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();
SearchArgument arg = builder.startAnd().in("salary", PredicateLeaf.Type.LONG, 3000L, 4000L).end().build();
UnboundPredicate expected = Expressions.in("salary", 3000L, 4000L);
UnboundPredicate actual = (UnboundPredicate) HiveIcebergFilterFactory.generateFilterExpression(arg);
assertEquals(actual.op(), expected.op());
assertEquals(actual.literals(), expected.literals());
assertEquals(actual.ref().name(), expected.ref().name());
}
use of org.apache.iceberg.expressions.UnboundPredicate in project iceberg by apache.
the class TestHiveIcebergFilterFactory method testIsNullOperand.
@Test
public void testIsNullOperand() {
SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();
SearchArgument arg = builder.startAnd().isNull("salary", PredicateLeaf.Type.LONG).end().build();
UnboundPredicate expected = Expressions.isNull("salary");
UnboundPredicate actual = (UnboundPredicate) HiveIcebergFilterFactory.generateFilterExpression(arg);
assertEquals(actual.op(), expected.op());
assertEquals(actual.ref().name(), expected.ref().name());
}
use of org.apache.iceberg.expressions.UnboundPredicate in project iceberg by apache.
the class TestHiveIcebergFilterFactory method testStringType.
@Test
public void testStringType() {
SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();
SearchArgument arg = builder.startAnd().equals("string", PredicateLeaf.Type.STRING, "Joe").end().build();
UnboundPredicate expected = Expressions.equal("string", "Joe");
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 testEqualsOperandRewrite.
@Test
public void testEqualsOperandRewrite() {
SearchArgument.Builder builder = SearchArgumentFactory.newBuilder();
SearchArgument arg = builder.startAnd().equals("float", PredicateLeaf.Type.FLOAT, Double.NaN).end().build();
UnboundPredicate expected = Expressions.isNaN("float");
UnboundPredicate actual = (UnboundPredicate) HiveIcebergFilterFactory.generateFilterExpression(arg);
assertPredicatesMatch(expected, actual);
}
Aggregations