use of io.hops.hopsworks.common.featurestore.statistics.StatisticsConfigDTO in project hopsworks by logicalclocks.
the class TestStatisticColumnController method testVerifyStatisticColumnsExistFg.
@Test
public void testVerifyStatisticColumnsExistFg() throws Exception {
FeaturegroupDTO featuregroupDTO = new FeaturegroupDTO();
featuregroupDTO.setName("fg1");
featuregroupDTO.setVersion(1);
StatisticsConfigDTO statisticsConfig = new StatisticsConfigDTO();
featuregroupDTO.setStatisticsConfig(statisticsConfig);
statisticsConfig.setColumns(Arrays.asList("ft1", "ft4"));
featuregroupDTO.setFeatures(Arrays.asList(new FeatureGroupFeatureDTO("ft1", null, ""), new FeatureGroupFeatureDTO("ft2", null, ""), new FeatureGroupFeatureDTO("ft3", null, "")));
// should throw exception
thrown.expect(FeaturestoreException.class);
statisticColumnController.verifyStatisticColumnsExist(featuregroupDTO);
// should not throw exception
statisticsConfig.setColumns(Arrays.asList("ft1", "ft2"));
statisticColumnController.verifyStatisticColumnsExist(featuregroupDTO);
}
use of io.hops.hopsworks.common.featurestore.statistics.StatisticsConfigDTO in project hopsworks by logicalclocks.
the class TestStatisticColumnController method testVerifyStatisticColumnsExistTD.
@Test
public void testVerifyStatisticColumnsExistTD() throws Exception {
TrainingDataset trainingDataset = new TrainingDataset();
StatisticsConfigDTO statisticsConfig = new StatisticsConfigDTO();
statisticsConfig.setColumns(Arrays.asList("ft1", "ft4"));
trainingDataset.setFeatures(Arrays.asList(new TrainingDatasetFeature(trainingDataset, "ft1", null, null, false, null), new TrainingDatasetFeature(trainingDataset, "ft2", null, null, false, null), new TrainingDatasetFeature(trainingDataset, "ft3", null, null, false, null)));
TrainingDatasetDTO trainingDatasetDTO = new TrainingDatasetDTO();
trainingDatasetDTO.setName("td1");
trainingDatasetDTO.setVersion(1);
trainingDatasetDTO.setStatisticsConfig(statisticsConfig);
// should throw exception
thrown.expect(FeaturestoreException.class);
statisticColumnController.verifyStatisticColumnsExist(trainingDatasetDTO, trainingDataset);
// should not throw exception
statisticsConfig.setColumns(Arrays.asList("ft1", "ft2"));
statisticColumnController.verifyStatisticColumnsExist(trainingDatasetDTO, trainingDataset);
}
Aggregations