use of io.hops.hopsworks.persistence.entity.featurestore.featuregroup.cached.TimeTravelFormat in project hopsworks by logicalclocks.
the class CachedFeaturegroupController method persistCachedFeaturegroupMetadata.
/**
* Persists metadata of a new cached feature group in the cached_feature_group table
*
* @param hiveTable the id of the Hive table in the Hive metastore
* @return Entity of the created cached feature group
*/
private CachedFeaturegroup persistCachedFeaturegroupMetadata(HiveTbls hiveTable, boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<FeatureGroupFeatureDTO> featureGroupFeatureDTOS) {
CachedFeaturegroup cachedFeaturegroup = new CachedFeaturegroup();
cachedFeaturegroup.setHiveTbls(hiveTable);
cachedFeaturegroup.setOnlineEnabled(onlineEnabled);
cachedFeaturegroup.setTimeTravelFormat(timeTravelFormat);
cachedFeaturegroup.setFeaturesExtraConstraints(buildFeatureExtraConstrains(featureGroupFeatureDTOS, cachedFeaturegroup));
cachedFeaturegroup.setCachedFeatures(featureGroupFeatureDTOS.stream().filter(feature -> feature.getDescription() != null).map(feature -> new CachedFeature(cachedFeaturegroup, feature.getName(), feature.getDescription())).collect(Collectors.toList()));
cachedFeatureGroupFacade.persist(cachedFeaturegroup);
return cachedFeaturegroup;
}
Aggregations