Search in sources :

Example 1 with MongoDbFilter

use of org.apache.beam.sdk.extensions.sql.meta.provider.mongodb.MongoDbTable.MongoDbFilter in project beam by apache.

the class MongoDbFilterTest method testIsSupported.

@Test
public void testIsSupported() {
    BeamRelNode beamRelNode = sqlEnv.parseQuery(query);
    assertThat(beamRelNode, instanceOf(BeamCalcRel.class));
    MongoDbFilter filter = MongoDbFilter.create(((BeamCalcRel) beamRelNode).getProgram().split().right);
    assertThat("Query: '" + query + "' is expected to be " + (isSupported ? "supported." : "unsupported."), filter.getNotSupported().isEmpty() == isSupported);
}
Also used : BeamCalcRel(org.apache.beam.sdk.extensions.sql.impl.rel.BeamCalcRel) BeamRelNode(org.apache.beam.sdk.extensions.sql.impl.rel.BeamRelNode) MongoDbFilter(org.apache.beam.sdk.extensions.sql.meta.provider.mongodb.MongoDbTable.MongoDbFilter) Test(org.junit.Test)

Aggregations

BeamCalcRel (org.apache.beam.sdk.extensions.sql.impl.rel.BeamCalcRel)1 BeamRelNode (org.apache.beam.sdk.extensions.sql.impl.rel.BeamRelNode)1 MongoDbFilter (org.apache.beam.sdk.extensions.sql.meta.provider.mongodb.MongoDbTable.MongoDbFilter)1 Test (org.junit.Test)1