use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterLessThan.
@Test
public void testToFilterLessThan() {
Expression expected = Expressions.lessThan(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 1);
Expression actual = transformer.transform(FilterExpression.lessThan(MetastoreColumn.ROW_GROUP_INDEX, 1));
assertEquals(expected.toString(), actual.toString());
}
use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterNull.
@Test
public void testToFilterNull() {
Expression expected = Expressions.alwaysTrue();
Expression actual = transformer.transform((FilterExpression) null);
assertEquals(expected.toString(), actual.toString());
}
use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testCombineNone.
@Test
public void testCombineNone() {
Expression expected = Expressions.alwaysTrue();
Expression actual = transformer.combine();
assertEquals(expected.toString(), actual.toString());
}
use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterConditionsFour.
@Test
public void testToFilterConditionsFour() {
Map<MetastoreColumn, Object> conditions = new LinkedHashMap<>();
conditions.put(MetastoreColumn.STORAGE_PLUGIN, "dfs");
conditions.put(MetastoreColumn.WORKSPACE, "tmp");
conditions.put(MetastoreColumn.TABLE_NAME, "nation");
conditions.put(MetastoreColumn.ROW_GROUP_INDEX, 4);
Expression expected = Expressions.and(Expressions.equal(MetastoreColumn.STORAGE_PLUGIN.columnName(), "dfs"), Expressions.equal(MetastoreColumn.WORKSPACE.columnName(), "tmp"), Expressions.equal(MetastoreColumn.TABLE_NAME.columnName(), "nation"), Expressions.equal(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 4));
assertEquals(expected.toString(), transformer.transform(conditions).toString());
}
use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterNotIn.
@Test
public void testToFilterNotIn() {
Expression expected = Expressions.notIn(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 1, 2);
Expression actual = transformer.transform(FilterExpression.notIn(MetastoreColumn.ROW_GROUP_INDEX, 1, 2));
assertEquals(expected.toString(), actual.toString());
}
Aggregations