use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterMetadataTypesSeveral.
@Test
public void testToFilterMetadataTypesSeveral() {
Expression expected = Expressions.in(MetastoreColumn.METADATA_TYPE.columnName(), MetadataType.PARTITION.name(), MetadataType.FILE.name());
Expression actual = transformer.transform(Sets.newHashSet(MetadataType.PARTITION, MetadataType.FILE));
assertEquals(expected.toString(), actual.toString());
}
use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterAnd.
@Test
public void testToFilterAnd() {
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));
Expression actual = transformer.transform(FilterExpression.and(FilterExpression.equal(MetastoreColumn.STORAGE_PLUGIN, "dfs"), FilterExpression.equal(MetastoreColumn.WORKSPACE, "tmp"), FilterExpression.equal(MetastoreColumn.TABLE_NAME, "nation"), FilterExpression.equal(MetastoreColumn.ROW_GROUP_INDEX, 4)));
assertEquals(expected.toString(), actual.toString());
}
use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterNotEqual.
@Test
public void testToFilterNotEqual() {
Expression expected = Expressions.notEqual(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 1);
Expression actual = transformer.transform(FilterExpression.notEqual(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 testToFilterIn.
@Test
public void testToFilterIn() {
Expression expected = Expressions.in(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 1, 2);
Expression actual = transformer.transform(FilterExpression.in(MetastoreColumn.ROW_GROUP_INDEX, 1, 2));
assertEquals(expected.toString(), actual.toString());
}
use of org.apache.iceberg.expressions.Expression in project drill by apache.
the class TestFilterTransformer method testToFilterConditionsTwo.
@Test
public void testToFilterConditionsTwo() {
Map<MetastoreColumn, Object> conditions = new LinkedHashMap<>();
conditions.put(MetastoreColumn.STORAGE_PLUGIN, "dfs");
conditions.put(MetastoreColumn.WORKSPACE, "tmp");
Expression expected = Expressions.and(Expressions.equal(MetastoreColumn.STORAGE_PLUGIN.columnName(), "dfs"), Expressions.equal(MetastoreColumn.WORKSPACE.columnName(), "tmp"));
assertEquals(expected.toString(), transformer.transform(conditions).toString());
}
Aggregations