Search in sources :

Example 1 with QueryDTO

use of io.hops.hopsworks.common.featurestore.query.QueryDTO in project hopsworks by logicalclocks.

the class TestPitJoinController method testIsPitEnabledTrueQueryDTO.

@Test
public void testIsPitEnabledTrueQueryDTO() {
    FeaturegroupDTO fg1 = new FeaturegroupDTO("ts");
    FeaturegroupDTO fg2 = new FeaturegroupDTO("ts");
    JoinDTO join1 = new JoinDTO(new QueryDTO(fg1, null), null, null);
    JoinDTO join2 = new JoinDTO(new QueryDTO(fg2, null), null, null);
    List<JoinDTO> joins = Arrays.asList(join1, join2);
    QueryDTO leftQuery = new QueryDTO(new FeaturegroupDTO("ts"), new ArrayList<>(), joins);
    Assert.assertEquals(true, pitJoinController.isPitEnabled(leftQuery));
}
Also used : JoinDTO(io.hops.hopsworks.common.featurestore.query.join.JoinDTO) QueryDTO(io.hops.hopsworks.common.featurestore.query.QueryDTO) FeaturegroupDTO(io.hops.hopsworks.common.featurestore.featuregroup.FeaturegroupDTO) Test(org.junit.Test)

Example 2 with QueryDTO

use of io.hops.hopsworks.common.featurestore.query.QueryDTO in project hopsworks by logicalclocks.

the class TestPitJoinController method testIsPitEnabledFalseQueryDTO.

@Test
public void testIsPitEnabledFalseQueryDTO() {
    FeaturegroupDTO fg1 = new FeaturegroupDTO("ts");
    // not event time enabled fg, therefore should be pitEnabled should be false
    FeaturegroupDTO fg2 = new FeaturegroupDTO();
    JoinDTO join1 = new JoinDTO(new QueryDTO(fg1, null), null, null);
    JoinDTO join2 = new JoinDTO(new QueryDTO(fg2, null), null, null);
    List<JoinDTO> joins = Arrays.asList(join1, join2);
    QueryDTO leftQuery = new QueryDTO(new FeaturegroupDTO("ts"), new ArrayList<>(), joins);
    Assert.assertEquals(false, pitJoinController.isPitEnabled(leftQuery));
}
Also used : JoinDTO(io.hops.hopsworks.common.featurestore.query.join.JoinDTO) QueryDTO(io.hops.hopsworks.common.featurestore.query.QueryDTO) FeaturegroupDTO(io.hops.hopsworks.common.featurestore.featuregroup.FeaturegroupDTO) Test(org.junit.Test)

Aggregations

FeaturegroupDTO (io.hops.hopsworks.common.featurestore.featuregroup.FeaturegroupDTO)2 QueryDTO (io.hops.hopsworks.common.featurestore.query.QueryDTO)2 JoinDTO (io.hops.hopsworks.common.featurestore.query.join.JoinDTO)2 Test (org.junit.Test)2