Search in sources :

Example 26 with Expression

use of org.apache.iceberg.expressions.Expression in project drill by apache.

the class TestFilterTransformer method testToFilterNot.

@Test
public void testToFilterNot() {
    Expression expected = Expressions.not(Expressions.equal(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 1));
    Expression actual = transformer.transform(FilterExpression.not(FilterExpression.equal(MetastoreColumn.ROW_GROUP_INDEX, 1)));
    assertEquals(expected.toString(), actual.toString());
}
Also used : FilterExpression(org.apache.drill.metastore.expressions.FilterExpression) Expression(org.apache.iceberg.expressions.Expression) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 27 with Expression

use of org.apache.iceberg.expressions.Expression in project drill by apache.

the class TestFilterTransformer method testToFilterOr.

@Test
public void testToFilterOr() {
    Expression expected = Expressions.or(Expressions.equal(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 1), Expressions.equal(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 2));
    Expression actual = transformer.transform(FilterExpression.or(FilterExpression.equal(MetastoreColumn.ROW_GROUP_INDEX, 1), FilterExpression.equal(MetastoreColumn.ROW_GROUP_INDEX, 2)));
    assertEquals(expected.toString(), actual.toString());
}
Also used : FilterExpression(org.apache.drill.metastore.expressions.FilterExpression) Expression(org.apache.iceberg.expressions.Expression) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 28 with Expression

use of org.apache.iceberg.expressions.Expression in project drill by apache.

the class TestFilterTransformer method testToFilterMetadataTypesOne.

@Test
public void testToFilterMetadataTypesOne() {
    Expression expected = Expressions.equal(MetastoreColumn.METADATA_TYPE.columnName(), MetadataType.PARTITION.name());
    Expression actual = transformer.transform(Collections.singleton(MetadataType.PARTITION));
    assertEquals(expected.toString(), actual.toString());
}
Also used : FilterExpression(org.apache.drill.metastore.expressions.FilterExpression) Expression(org.apache.iceberg.expressions.Expression) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 29 with Expression

use of org.apache.iceberg.expressions.Expression in project drill by apache.

the class TestFilterTransformer method testToFilterGreaterThanOrEqual.

@Test
public void testToFilterGreaterThanOrEqual() {
    Expression expected = Expressions.greaterThanOrEqual(MetastoreColumn.ROW_GROUP_INDEX.columnName(), 1);
    Expression actual = transformer.transform(FilterExpression.greaterThanOrEqual(MetastoreColumn.ROW_GROUP_INDEX, 1));
    assertEquals(expected.toString(), actual.toString());
}
Also used : FilterExpression(org.apache.drill.metastore.expressions.FilterExpression) Expression(org.apache.iceberg.expressions.Expression) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 30 with Expression

use of org.apache.iceberg.expressions.Expression in project drill by apache.

the class TestFilterTransformer method testCombineOne.

@Test
public void testCombineOne() {
    Expression expected = Expressions.equal("a", 1);
    Expression actual = transformer.combine(expected);
    assertEquals(expected.toString(), actual.toString());
}
Also used : FilterExpression(org.apache.drill.metastore.expressions.FilterExpression) Expression(org.apache.iceberg.expressions.Expression) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Aggregations

Expression (org.apache.iceberg.expressions.Expression)40 FilterExpression (org.apache.drill.metastore.expressions.FilterExpression)28 IcebergBaseTest (org.apache.drill.metastore.iceberg.IcebergBaseTest)26 Test (org.junit.Test)26 MetastoreColumn (org.apache.drill.metastore.MetastoreColumn)5 Map (java.util.Map)4 Path (org.apache.hadoop.fs.Path)3 TupleDomain (com.facebook.presto.common.predicate.TupleDomain)2 HashMap (java.util.HashMap)2 LogicalExpression (org.apache.drill.common.expression.LogicalExpression)2 TableMetadataUnit (org.apache.drill.metastore.components.tables.TableMetadataUnit)2 Delete (org.apache.drill.metastore.iceberg.operate.Delete)2 MapWork (org.apache.hadoop.hive.ql.plan.MapWork)2 TableScan (org.apache.iceberg.TableScan)2 Domain (com.facebook.presto.common.predicate.Domain)1 Marker (com.facebook.presto.common.predicate.Marker)1 Range (com.facebook.presto.common.predicate.Range)1 SortedRangeSet (com.facebook.presto.common.predicate.SortedRangeSet)1 ValueSet (com.facebook.presto.common.predicate.ValueSet)1 ArrayType (com.facebook.presto.common.type.ArrayType)1