public class FeatureStore extends FeatureStoreBase<com.logicalclocks.hsfs.beam.constructor.Query>
DEFAULT_VERSION, featureGroupApi, LOGGER, storageConnectorApi, trainingDatasetApi
Constructor and Description |
---|
FeatureStore() |
Modifier and Type | Method and Description |
---|---|
com.logicalclocks.hsfs.beam.StreamFeatureGroup.StreamFeatureGroupBuilder |
createStreamFeatureGroup()
Create a feature group builder object.
|
StreamFeatureGroup |
createStreamFeatureGroup(@NonNull String name,
Integer version,
String description,
Boolean onlineEnabled,
TimeTravelFormat timeTravelFormat,
List<String> primaryKeys,
List<String> partitionKeys,
String eventTime,
String hudiPrecombineKey,
List<Feature> features,
StatisticsConfig statisticsConfig,
StorageConnector storageConnector,
String path)
Create a feature group object.
|
FeatureView |
getFeatureView(String name)
Get a feature view object from the selected feature store.
|
FeatureView |
getFeatureView(@NonNull String name,
@NonNull Integer version)
Get a feature view object from the selected feature store.
|
StreamFeatureGroup |
getOrCreateStreamFeatureGroup(@NonNull String name,
Integer version,
String description,
Boolean onlineEnabled,
TimeTravelFormat timeTravelFormat,
List<String> primaryKeys,
List<String> partitionKeys,
String eventTime,
String hudiPrecombineKey,
List<Feature> features,
StatisticsConfig statisticsConfig,
StorageConnector storageConnector,
String path)
Get a feature group metadata object or create a new one if it doesn't exists.
|
Object |
getStreamFeatureGroup(String name)
Get a stream feature group object from the feature store.
|
StreamFeatureGroup |
getStreamFeatureGroup(@NonNull String name,
@NonNull Integer version)
Get a stream feature group object from the feature store.
|
getAdlsConnector, getBigqueryConnector, getGcsConnector, getHopsFsConnector, getJdbcConnector, getKafkaConnector, getOnlineStorageConnector, getRedshiftConnector, getS3Connector, getSnowflakeConnector, getStorageConnector, toString
public com.logicalclocks.hsfs.beam.StreamFeatureGroup.StreamFeatureGroupBuilder createStreamFeatureGroup()
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
// create feature group metadata object
StreamFeatureGroup streamFeatureGroup = fs.createStreamFeatureGroup()
.name("documentation_example")
.version(1)
.primaryKeys(Collections.singletonList("pk"))
.eventTime("event_time")
.onlineEnabled(true)
.features(features)
.build();
// save the feature group metadata object on the feature store
streamFeatureGroup.save()
public StreamFeatureGroup createStreamFeatureGroup(@NonNull @NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKeys, List<String> partitionKeys, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, StorageConnector storageConnector, String path)
FeatureStoreBase
createStreamFeatureGroup
in class FeatureStoreBase<com.logicalclocks.hsfs.beam.constructor.Query>
name
- the name of the feature groupversion
- the version of the feature groupdescription
- descrption of the feature grouponlineEnabled
- whether the feature group should be online enabledtimeTravelFormat
- the data format to use to store the offline dataprimaryKeys
- list of primary keyspartitionKeys
- list of partition keyseventTime
- the feature/column to use as event timehudiPrecombineKey
- if the timeTravelFormat is set to hudi, the feature/column to use as precombine keyfeatures
- the list of feature objects if defined explicitlystatisticsConfig
- the statistics configuration for the feature groupstorageConnector
- the storage connector to use to store the offline
feature data (Default stored internally in Hopsworks).path
- the path on the storage where to store the feature data.public StreamFeatureGroup getOrCreateStreamFeatureGroup(@NonNull @NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKeys, List<String> partitionKeys, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, StorageConnector storageConnector, String path) throws IOException, FeatureStoreException
FeatureStoreBase
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
StreamFeatureGroup streamFeatureGroup = featureStore.getOrCreateStreamFeatureGroup(
"doc_example",
1,
"Feature group for example in documentation",
true,
TimeTravelFormat.HUDI,
Collections.singletonList("primary_key"),
Collections.singletonList("partition_key"),
"event_time",
null,
features,
null,
new StatisticsConfig(true, true, true, true),
null
);
streamFeatureGroup.save()
getOrCreateStreamFeatureGroup
in class FeatureStoreBase<com.logicalclocks.hsfs.beam.constructor.Query>
name
- the name of the feature groupversion
- the version of the feature groupdescription
- descrption of the feature grouponlineEnabled
- whether the feature group should be online enabledtimeTravelFormat
- the data format to use to store the offline dataprimaryKeys
- list of primary keyspartitionKeys
- list of partition keyseventTime
- the feature/column to use as event timehudiPrecombineKey
- if the timeTravelFormat is set to hudi, the feature/column to use as precombine keyfeatures
- the list of feature objects if defined explicitlystatisticsConfig
- the statistics configuration for the feature groupstorageConnector
- the storage connector to use to store the offline
feature data (Default stored internally in Hopsworks).path
- the path on the storage where to store the feature data.IOException
FeatureStoreException
public Object getStreamFeatureGroup(String name) throws FeatureStoreException, IOException
Getting a stream feature group metadata handle enables to interact with the feature group, such as read the data or use the `Query`-API to perform joins between feature groups and create feature views.
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
FeatureGroup fg = fs.getStreamFeatureGroup("electricity_prices", 1);
getStreamFeatureGroup
in class FeatureStoreBase<com.logicalclocks.hsfs.beam.constructor.Query>
name
- the name of the feature groupFeatureStoreException
- If unable to retrieve feature group from the feature store.IOException
- Generic IO exception.public StreamFeatureGroup getStreamFeatureGroup(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException
Getting a stream feature group metadata handle enables to interact with the feature group, such as read the data or use the `Query`-API to perform joins between feature groups and create feature views.
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
FeatureGroup fg = fs.getStreamFeatureGroup("electricity_prices", 1);
getStreamFeatureGroup
in class FeatureStoreBase<com.logicalclocks.hsfs.beam.constructor.Query>
name
- the name of the feature groupversion
- the version of the feature groupFeatureStoreException
- If unable to retrieve feature group from the feature store.IOException
- Generic IO exception.public FeatureView getFeatureView(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
FeatureView fv = fs.getFeatureView("fv_name", 1);
getFeatureView
in class FeatureStoreBase<com.logicalclocks.hsfs.beam.constructor.Query>
name
- Name of the feature view.version
- Version to get.FeatureStoreException
- If unable to retrieve FeatureView from the feature store.IOException
- Generic IO exception.public FeatureView getFeatureView(String name) throws FeatureStoreException, IOException
// get feature store handle
FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore();
FeatureView fv = fs.getFeatureView("fv_name", 1);
getFeatureView
in class FeatureStoreBase<com.logicalclocks.hsfs.beam.constructor.Query>
name
- Name of the feature view.FeatureStoreException
- If unable to retrieve FeatureView from the feature store.IOException
- Generic IO exception.Copyright © 2025. All rights reserved.