Class FeatureStore
-
Field Summary
Fields inherited from class com.logicalclocks.hsfs.FeatureStoreBase
DEFAULT_VERSION, featureGroupApi, LOGGER, storageConnectorApi, trainingDatasetApi -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate external feature group builder object.Create feature group builder object.Deprecated.createStreamFeatureGroup(@NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKey, List<String> partitionKey, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, DataSource dataSource) Create a stream feature group object.createStreamFeatureGroup(@NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKey, List<String> partitionKey, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, StorageConnector storageConnector, String path) Create a feature group object.Deprecated.getAdlsConnector(String name) Get a previously created Adls compliant storage connector from the feature store.getBigqueryConnector(String name) Get a previously created BigQuery compliant storage connector from the feature store.getExternalFeatureGroup(@NonNull String name, @NonNull Integer version) Get an external feature group object from the feature store.Get an external feature group object with default version `1` from the feature store.scala.collection.Seq<ExternalFeatureGroup>getExternalFeatureGroups(@NonNull String name) Get a list of all versions of an external feature group from the feature store.getFeatureGroup(@NonNull String name, @NonNull Integer version) Get a feature group object from the feature store.getFeatureGroup(String name) Get a feature group object with default version `1` from the feature store.scala.collection.Seq<FeatureGroup>getFeatureGroups(@NonNull String name) Get a list of all versions of a feature group from the feature store.getFeatureView(@NonNull String name, @NonNull Integer version) Get a feature view object from the selected feature store.getFeatureView(String name) Get a feature view object with the default version `1` from the selected feature store.getGcsConnector(String name) Get a previously created Gcs compliant storage connector from the feature store.getHopsFsConnector(String name) Get a previously created HopsFs compliant storage connector from the feature store.getJdbcConnector(String name) Get a previously created JDBC compliant storage connector from the feature store.getKafkaConnector(String name) Get a previously created Kafka compliant storage connector from the feature store.getOnDemandFeatureGroup(@NonNull String name, @NonNull Integer version) Deprecated.Deprecated.scala.collection.Seq<ExternalFeatureGroup>getOnDemandFeatureGroups(@NonNull String name) Deprecated.Get a previously created JDBC compliant storage connector from the feature store to connect to the online feature store.getOrCreateFeatureGroup(String name, Integer version) Get feature group metadata object or create a new one if it doesn't exist.getOrCreateFeatureGroup(String name, Integer version, String description, List<String> primaryKeys, List<String> partitionKeys, String hudiPrecombineKey, boolean onlineEnabled, TimeTravelFormat timeTravelFormat, StatisticsConfig statisticsConfig, String topicName, String notificationTopicName, String eventTime, OnlineConfig onlineConfig) Get feature group metadata object or create a new one if it doesn't exist.getOrCreateFeatureGroup(String name, Integer version, List<String> primaryKeys, boolean onlineEnabled, String eventTime) Get feature group metadata object or create a new one if it doesn't exist.getOrCreateFeatureGroup(String name, Integer version, List<String> primaryKeys, List<String> partitionKeys, boolean onlineEnabled, String eventTime) Get feature group metadata object or create a new one if it doesn't exist.getOrCreateFeatureView(String name, Query query, Integer version) Get feature view metadata object or create a new one if it doesn't exist.getOrCreateFeatureView(String name, Query query, Integer version, String description, List<String> labels) Get feature view metadata object or create a new one if it doesn't exist.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, DataSource dataSource, OnlineConfig onlineConfig) Get a stream feature group metadata object or create a new one if it doesn't exist.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, OnlineConfig onlineConfig) Get stream feature group metadata object or create a new one if it doesn't exist.getOrCreateStreamFeatureGroup(String name, Integer version) Get stream feature group metadata object or create a new one if it doesn't exist.getOrCreateStreamFeatureGroup(String name, Integer version, String description, List<String> primaryKeys, List<String> partitionKeys, String hudiPrecombineKey, boolean onlineEnabled, StatisticsConfig statisticsConfig, String eventTime, TimeTravelFormat timeTravelFormat) Get stream feature group metadata object or create a new one if it doesn't exist.getOrCreateStreamFeatureGroup(String name, Integer version, List<String> primaryKeys, boolean onlineEnabled, String eventTime) Get stream feature group metadata object or create a new one if it doesn't exist.getOrCreateStreamFeatureGroup(String name, Integer version, List<String> primaryKeys, List<String> partitionKeys, boolean onlineEnabled, String eventTime) Get stream feature group metadata object or create a new one if it doesn't exist.getRedshiftConnector(String name) Get a previously created Redshift compliant storage connector from the feature store.getS3Connector(String name) Get a previously created S3 compliant storage connector from the feature store.getSnowflakeConnector(String name) Get a previously created Snowflake compliant storage connector from the feature store.getSqlConnector(String name) Get a previously created SQL storage connector from the feature store.getStorageConnector(String name) Get a previously created storage connector from the feature store.getStreamFeatureGroup(@NonNull String name, @NonNull Integer version) Get a stream feature group object from the feature store.getStreamFeatureGroup(String name) Get a stream feature group object with default version `1` from the feature store.getTrainingDataset(@NonNull String name, @NonNull Integer version) Deprecated.getTrainingDataset(String name) Deprecated.scala.collection.Seq<TrainingDataset>getTrainingDatasets(@NonNull String name) Deprecated.org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>Methods inherited from class com.logicalclocks.hsfs.FeatureStoreBase
getDataSource, toString
-
Constructor Details
-
FeatureStore
public FeatureStore()
-
-
Method Details
-
getFeatureGroup
public FeatureGroup getFeatureGroup(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException Get a feature group object from the feature store.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.getFeatureGroup("electricity_prices", 1);- Parameters:
name- the name of the feature groupversion- the version of the feature group- Returns:
- FeatureGroup The feature group metadata object.
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
getFeatureGroup
Get a feature group object with default version `1` from the feature store.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.getFeatureGroup("electricity_prices");- Parameters:
name- the name of the feature group- Returns:
- FeatureGroup The feature group metadata object.
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
getFeatureGroups
public scala.collection.Seq<FeatureGroup> getFeatureGroups(@NonNull @NonNull String name) throws FeatureStoreException, IOException Get a list of all versions of a feature group from the feature store.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.getFeatureGroups("electricity_prices");- Parameters:
name- the name of the feature group- Returns:
- List of FeatureGroup metadata objects.
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
createFeatureGroup
Create feature group builder object.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup.FeatureGroupBuilder = fs.createFeatureGroup()- Returns:
- FeatureGroup.FeatureGroupBuilder a FeatureGroup builder object.
-
getOrCreateFeatureGroup
public FeatureGroup getOrCreateFeatureGroup(String name, Integer version) throws IOException, FeatureStoreException Get feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup fg = fs.getOrCreateFeatureGroup("fg_name", 1);- Parameters:
name- of the feature group to retrieve or create.version- of the feature group to retrieve or create.- Returns:
- FeatureGroup The feature group metadata object.
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve FeatureGroup from the feature store.
-
getOrCreateFeatureGroup
public FeatureGroup getOrCreateFeatureGroup(String name, Integer version, List<String> primaryKeys, boolean onlineEnabled, String eventTime) throws IOException, FeatureStoreException Get feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup fg = fs.getOrCreateFeatureGroup("fg_name", 1, primaryKeys, true, "datetime");- Parameters:
name- of the feature group to retrieve or create.version- of the feature group to retrieve or create.primaryKeys- A list of feature names to be used as primary key for the feature group. This primary key can be a composite key of multiple features and will be used as joining key.onlineEnabled- Define whether the feature group should be made available also in the online feature store for low latency access.eventTime- Name of the feature containing the event time for the features in this feature group. If eventTime is set the feature group can be used for point-in-time joins. The supported data types for the eventTime column are: timestamp, date and bigint- Returns:
- FeatureGroup: The feature group metadata object
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve FeatureGroup from the feature store.
-
getOrCreateFeatureGroup
public FeatureGroup getOrCreateFeatureGroup(String name, Integer version, List<String> primaryKeys, List<String> partitionKeys, boolean onlineEnabled, String eventTime) throws IOException, FeatureStoreException Get feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup fg = fs.getOrCreateFeatureGroup("fg_name", 1, primaryKeys, partitionKeys, true, "datetime");- Parameters:
name- of the feature group to retrieve or create.version- of the feature group to retrieve or create.primaryKeys- A list of feature names to be used as primary key for the feature group. This primary key can be a composite key of multiple features and will be used as joining key.partitionKeys- A list of feature names to be used as partition key when writing the feature data to the offline storage.onlineEnabled- Define whether the feature group should be made available also in the online feature store for low latency access.eventTime- Name of the feature containing the event time for the features in this feature group. If eventTime is set the feature group can be used for point-in-time joins. The supported data types for the eventTime column are: timestamp, date and bigint- Returns:
- FeatureGroup: The feature group metadata object
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve FeatureGroup from the feature store.
-
getOrCreateFeatureGroup
public FeatureGroup getOrCreateFeatureGroup(String name, Integer version, String description, List<String> primaryKeys, List<String> partitionKeys, String hudiPrecombineKey, boolean onlineEnabled, TimeTravelFormat timeTravelFormat, StatisticsConfig statisticsConfig, String topicName, String notificationTopicName, String eventTime, OnlineConfig onlineConfig) throws IOException, FeatureStoreException Get feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup fg = fs.getOrCreateFeatureGroup("fg_name", 1, primaryKeys, partitionKeys, true, "datetime");- Parameters:
name- of the feature group to retrieve or create.version- of the feature group to retrieve or create.description- contents of the feature group to improve discoverability for Data ScientistsprimaryKeys- A list of feature names to be used as primary key for the feature group. This primary key can be a composite key of multiple features and will be used as joining key.partitionKeys- A list of feature names to be used as partition key when writing the feature data to the offline storage.hudiPrecombineKey- A feature name to be used as a precombine key for the `HUDI` feature group. If feature group has time travel format `HUDI` and hudi precombine key was not specified then the first primary key of the feature group will be used as hudi precombine key.onlineEnabled- Define whether the feature group should be made available also in the online feature store for low latency access.timeTravelFormat- Format used for time travel: `TimeTravelFormat.HUDI` or `TimeTravelFormat.NONE`.statisticsConfig- A configuration object, to generally enable descriptive statistics computation for this feature group, `"correlations`" to turn on feature correlation computation, `"histograms"` to compute feature value frequencies and `"exact_uniqueness"` to compute uniqueness, distinctness and entropy. The values should be booleans indicating the setting. To fully turn off statistics computation pass `statisticsConfig=false`.topicName- Optionally, define the name of the topic used for data ingestion. If left undefined it defaults to using project topic.notificationTopicName- Optionally, define the name of the topic used for sending notifications when entries are inserted or updated on the online feature store. If left undefined no notifications are sent.eventTime- Name of the feature containing the event time for the features in this feature group. If eventTime is set the feature group can be used for point-in-time joins. The supported data types for the eventTime column are: timestamp, date and bigintonlineConfig- Optionally, define configuration which is used to configure online table.- Returns:
- FeatureGroup: The feature group metadata object.
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve FeatureGroup from the feature store.
-
getStreamFeatureGroup
public StreamFeatureGroup getStreamFeatureGroup(String name) throws FeatureStoreException, IOException Get a stream feature group object with default version `1` from the feature store.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"); <- Specified by:
getStreamFeatureGroupin classFeatureStoreBase<Query>- Parameters:
name- the name of the feature group- Returns:
- FeatureGroup
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
getStreamFeatureGroup
public StreamFeatureGroup getStreamFeatureGroup(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException Get a stream feature group object from the feature store.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);- Specified by:
getStreamFeatureGroupin classFeatureStoreBase<Query>- Parameters:
name- the name of the feature groupversion- the version of the feature group- Returns:
- StreamFeatureGroup The stream feature group metadata object.
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
createStreamFeatureGroup
public StreamFeatureGroup createStreamFeatureGroup(@NonNull @NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKey, List<String> partitionKey, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, StorageConnector storageConnector, String path) Description copied from class:FeatureStoreBaseCreate a feature group object.- Specified by:
createStreamFeatureGroupin classFeatureStoreBase<Query>- Parameters:
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 dataprimaryKey- list of primary keyspartitionKey- 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.- Returns:
- The feature group metadata object.
-
createStreamFeatureGroup
public StreamFeatureGroup createStreamFeatureGroup(@NonNull @NonNull String name, Integer version, String description, Boolean onlineEnabled, TimeTravelFormat timeTravelFormat, List<String> primaryKey, List<String> partitionKey, String eventTime, String hudiPrecombineKey, List<Feature> features, StatisticsConfig statisticsConfig, DataSource dataSource) Description copied from class:FeatureStoreBaseCreate a stream feature group object.- Specified by:
createStreamFeatureGroupin classFeatureStoreBase<Query>- Parameters:
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 dataprimaryKey- list of primary keyspartitionKey- 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 groupdataSource- the data source specifying the location of the data.- Returns:
- The feature group metadata object.
-
getOrCreateStreamFeatureGroup
public StreamFeatureGroup getOrCreateStreamFeatureGroup(String name, Integer version) throws IOException, FeatureStoreException Get stream feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup fg = fs.getOrCreateStreamFeatureGroup("fg_name", 1);- Parameters:
name- of the feature group to retrieve or create.version- of the feature group to retrieve or create.- Returns:
- FeatureGroup The feature group metadata object.
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve StreamFeatureGroup from the feature store.
-
getOrCreateStreamFeatureGroup
public StreamFeatureGroup getOrCreateStreamFeatureGroup(String name, Integer version, List<String> primaryKeys, boolean onlineEnabled, String eventTime) throws IOException, FeatureStoreException Get stream feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup fg = fs.getOrCreateStreamFeatureGroup("fg_name", 1, primaryKeys, true, "datetime");- Parameters:
name- Name of the feature group to retrieve or create.version- Version of the feature group to retrieve or create.primaryKeys- A list of feature names to be used as primary key for the feature group. This primary key can be a composite key of multiple features and will be used as joining key.onlineEnabled- Define whether the feature group should be made available also in the online feature store for low latency access.eventTime- Name of the feature containing the event time for the features in this feature group. If eventTime is set the feature group can be used for point-in-time joins. The supported data types for the eventTime column are: timestamp, date and bigint- Returns:
- FeatureGroup The feature group metadata object.
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve StreamFeatureGroup from the feature store.
-
getOrCreateStreamFeatureGroup
public StreamFeatureGroup getOrCreateStreamFeatureGroup(String name, Integer version, List<String> primaryKeys, List<String> partitionKeys, boolean onlineEnabled, String eventTime) throws IOException, FeatureStoreException Get stream feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureGroup fg = fs.getOrCreateStreamFeatureGroup("fg_name", 1, primaryKeys, partitionKeys, true, "datetime");- Parameters:
name- Name of the feature group to retrieve or create.version- Version of the feature group to retrieve or create.primaryKeys- A list of feature names to be used as primary key for the feature group. This primary key can be a composite key of multiple features and will be used as joining key.partitionKeys- A list of feature names to be used as partition key when writing the feature data to the offline storage.onlineEnabled- Define whether the feature group should be made available also in the online feature store for low latency access.eventTime- Name of the feature containing the event time for the features in this feature group. If eventTime is set the feature group can be used for point-in-time joins. The supported data types for the eventTime column are: timestamp, date and bigint- Returns:
- FeatureGroup: The feature group metadata object
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve StreamFeatureGroup from the feature store.
-
getOrCreateStreamFeatureGroup
public StreamFeatureGroup getOrCreateStreamFeatureGroup(String name, Integer version, String description, List<String> primaryKeys, List<String> partitionKeys, String hudiPrecombineKey, boolean onlineEnabled, StatisticsConfig statisticsConfig, String eventTime, TimeTravelFormat timeTravelFormat) throws IOException, FeatureStoreException Get stream feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StreamFeatureGroup fg = fs.getOrCreateStreamFeatureGroup("fg_name", 1, primaryKeys, partitionKeys, true, "datetime");- Parameters:
name- of the feature group to retrieve or create.version- of the feature group to retrieve or create.description- contents of the feature group to improve discoverability for Data ScientistsprimaryKeys- A list of feature names to be used as primary key for the feature group. This primary key can be a composite key of multiple features and will be used as joining key.partitionKeys- A list of feature names to be used as partition key when writing the feature data to the offline storage.hudiPrecombineKey- A feature name to be used as a precombine key for the `HUDI` feature group. If feature group has time travel format `HUDI` and hudi precombine key was not specified then the first primary key of the feature group will be used as hudi precombine key.onlineEnabled- Define whether the feature group should be made available also in the online feature store for low latency access.timeTravelFormat- Format used for time travel, defaults to `"HUDI"`.statisticsConfig- A configuration object, to generally enable descriptive statistics computation for this feature group, `"correlations`" to turn on feature correlation computation, `"histograms"` to compute feature value frequencies and `"exact_uniqueness"` to compute uniqueness, distinctness and entropy. The values should be booleans indicating the setting. To fully turn off statistics computation pass `statisticsConfig=false`.eventTime- Name of the feature containing the event time for the features in this feature group. If eventTime is set the feature group can be used for point-in-time joins.- Returns:
- FeatureGroup: The feature group metadata object.
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve FeatureGroup from the feature store.
-
getOrCreateStreamFeatureGroup
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, OnlineConfig onlineConfig) throws IOException, FeatureStoreException Get stream feature group metadata object or create a new one if it doesn't exist. This method doesn't update existing feature group metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StreamFeatureGroup fg = fs.getOrCreateStreamFeatureGroup("fg_name", 1, primaryKeys, partitionKeys, hudiPrecombineKey, true, statisticsConfig, "datetime", timeTravelFormat, features, storageConnector, path, onlineConfig);- Specified by:
getOrCreateStreamFeatureGroupin classFeatureStoreBase<Query>- Parameters:
name- of the feature group to retrieve or create.version- of the feature group to retrieve or create.description- contents of the feature group to improve discoverability for Data ScientistsprimaryKeys- A list of feature names to be used as primary key for the feature group. This primary key can be a composite key of multiple features and will be used as joining key.partitionKeys- A list of feature names to be used as partition key when writing the feature data to the offline storage.hudiPrecombineKey- A feature name to be used as a precombine key for the `HUDI` feature group. If feature group has time travel format `HUDI` and hudi precombine key was not specified then the first primary key of the feature group will be used as hudi precombine key.onlineEnabled- Define whether the feature group should be made available also in the online feature store for low latency access.timeTravelFormat- Format used for time travel, defaults to `"HUDI"`.statisticsConfig- A configuration object, to generally enable descriptive statistics computation for this feature group, `"correlations`" to turn on feature correlation computation, `"histograms"` to compute feature value frequencies and `"exact_uniqueness"` to compute uniqueness, distinctness and entropy. The values should be booleans indicating the setting. To fully turn off statistics computation pass `statisticsConfig=false`.eventTime- Name of the feature containing the event time for the features in this feature group. If eventTime is set the feature group can be used for point-in-time joins.onlineConfig- Optionally, define configuration which is used to configure online table.features- the list of feature objects if defined explicitlystorageConnector- 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.- Returns:
- FeatureGroup: The feature group metadata object.
- Throws:
IOException- Generic IO exception.FeatureStoreException- If unable to retrieve FeatureGroup from the feature store.
-
getOrCreateStreamFeatureGroup
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, DataSource dataSource, OnlineConfig onlineConfig) throws IOException, FeatureStoreException Description copied from class:FeatureStoreBaseGet a stream feature group metadata object or create a new one if it doesn't exist.- Specified by:
getOrCreateStreamFeatureGroupin classFeatureStoreBase<Query>- Parameters:
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 groupdataSource- the data source specifying the location of the data.onlineConfig- the online configuration for the feature group.- Returns:
- The feature group metadata object.
- Throws:
IOExceptionFeatureStoreException
-
createExternalFeatureGroup
Create external feature group builder object.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); ExternalFeatureGroup.ExternalFeatureGroupBuilder = fs.createExternalFeatureGroup()- Returns:
- ExternalFeatureGroup.ExternalFeatureGroupBuilder a ExternalFeatureGroup builder object.
-
createOnDemandFeatureGroup
Deprecated. -
getExternalFeatureGroups
public scala.collection.Seq<ExternalFeatureGroup> getExternalFeatureGroups(@NonNull @NonNull String name) throws FeatureStoreException, IOException Get a list of all versions of an external feature group from the feature store.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.getExternalFeatureGroups("external_fg_name");- Parameters:
name- The name of the feature group.- Returns:
- List of ExternalFeatureGroup metadata objects.
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
getExternalFeatureGroup
public ExternalFeatureGroup getExternalFeatureGroup(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException Get an external feature group object from the feature store.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(); ExternalFeatureGroup fg = fs.getExternalFeatureGroup("external_fg_name", 1);- Parameters:
name- the name of the feature groupversion- the version of the feature group- Returns:
- ExternalFeatureGroup The external feature group metadata object.
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
getExternalFeatureGroup
public ExternalFeatureGroup getExternalFeatureGroup(String name) throws FeatureStoreException, IOException Get an external feature group object with default version `1` from the feature store.Getting external 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(); ExternalFeatureGroup fg = fs.getExternalFeatureGroup("external_fg_name");- Parameters:
name- the name of the feature group- Returns:
- ExternalFeatureGroup The external feature group metadata object.
- Throws:
FeatureStoreException- If unable to retrieve feature group from the feature store.IOException- Generic IO exception.
-
getStorageConnector
Get a previously created storage connector from the feature store.Storage connectors encapsulate all information needed for the execution engine to read and write to a specific storage.
If you want to connect to the online feature store, see the getOnlineStorageConnector` method to get the JDBC connector for the Online Feature Store.
// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector sc = fs.getStorageConnector("sc_name");- Overrides:
getStorageConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getHopsFsConnector
public StorageConnector.HopsFsConnector getHopsFsConnector(String name) throws FeatureStoreException, IOException Get a previously created HopsFs compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.HopsFsConnector hfsSc = fs.getHopsFsConnector("hfs_sc_name");- Overrides:
getHopsFsConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.HopsFsConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getJdbcConnector
public StorageConnector.JdbcConnector getJdbcConnector(String name) throws FeatureStoreException, IOException Get a previously created JDBC compliant storage connector from the feature store.If you want to connect to the online feature store, see the getOnlineStorageConnector` method to get the JDBC connector for the Online Feature Store.
// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.JdbcConnector jdbcSc = fs.getJdbcConnector("jdbc_sc_name");- Overrides:
getJdbcConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the jdbc storage connector to retrieve.- Returns:
- StorageConnector.JdbcConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getOnlineStorageConnector
public StorageConnector.JdbcConnector getOnlineStorageConnector() throws FeatureStoreException, IOExceptionGet a previously created JDBC compliant storage connector from the feature store to connect to the online feature store.//get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.JdbcConnector onlineSc = fs.getOnlineStorageConnector("online_sc_name");- Overrides:
getOnlineStorageConnectorin classFeatureStoreBase<Query>- Returns:
- StorageConnector.JdbcConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getS3Connector
public StorageConnector.S3Connector getS3Connector(String name) throws FeatureStoreException, IOException Get a previously created S3 compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.S3Connector s3Sc = fs.getS3Connector("s3_sc_name");- Overrides:
getS3Connectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.S3Connector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getRedshiftConnector
public StorageConnector.RedshiftConnector getRedshiftConnector(String name) throws FeatureStoreException, IOException Get a previously created Redshift compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.RedshiftConnector rshSc = fs.getRedshiftConnector("rsh_sc_name");- Overrides:
getRedshiftConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.RedshiftConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getSnowflakeConnector
public StorageConnector.SnowflakeConnector getSnowflakeConnector(String name) throws FeatureStoreException, IOException Get a previously created Snowflake compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.SnowflakeConnector snflSc = fs.getSnowflakeConnector("snfl_sc_name");- Overrides:
getSnowflakeConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.SnowflakeConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getAdlsConnector
public StorageConnector.AdlsConnector getAdlsConnector(String name) throws FeatureStoreException, IOException Get a previously created Adls compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.AdlsConnectorr adlslSc = fs.getAdlsConnector("adls_sc_name");- Overrides:
getAdlsConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.AdlsConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getKafkaConnector
public StorageConnector.KafkaConnector getKafkaConnector(String name) throws FeatureStoreException, IOException Get a previously created Kafka compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.KafkaConnector kafkaSc = fs.getKafkaConnector("kafka_sc_name");- Overrides:
getKafkaConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.KafkaConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getBigqueryConnector
public StorageConnector.BigqueryConnector getBigqueryConnector(String name) throws FeatureStoreException, IOException Get a previously created BigQuery compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.BigqueryConnector bigqSc = fs.getBigqueryConnector("bigq_sc_name");- Overrides:
getBigqueryConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.BigqueryConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getGcsConnector
public StorageConnector.GcsConnector getGcsConnector(String name) throws FeatureStoreException, IOException Get a previously created Gcs compliant storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.GcsConnector gcsSc = fs.getGcsConnector("gsc_sc_name");- Overrides:
getGcsConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.GcsConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getSqlConnector
public StorageConnector.SqlConnector getSqlConnector(String name) throws FeatureStoreException, IOException Get a previously created SQL storage connector from the feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); StorageConnector.SqlConnector sqlSc = fs.getSqlConnector("sql_sc_name");- Specified by:
getSqlConnectorin classFeatureStoreBase<Query>- Parameters:
name- Name of the storage connector to retrieve.- Returns:
- StorageConnector.SqlConnector Storage connector object.
- Throws:
FeatureStoreException- If unable to retrieve StorageConnector from the feature store.IOException- Generic IO exception.
-
getOnDemandFeatureGroup
@Deprecated public ExternalFeatureGroup getOnDemandFeatureGroup(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException Deprecated.- Throws:
FeatureStoreExceptionIOException
-
getOnDemandFeatureGroup
@Deprecated public ExternalFeatureGroup getOnDemandFeatureGroup(String name) throws FeatureStoreException, IOException Deprecated.- Throws:
FeatureStoreExceptionIOException
-
getOnDemandFeatureGroups
@Deprecated public scala.collection.Seq<ExternalFeatureGroup> getOnDemandFeatureGroups(@NonNull @NonNull String name) throws FeatureStoreException, IOException Deprecated.- Throws:
FeatureStoreExceptionIOException
-
createFeatureView
-
getOrCreateFeatureView
public FeatureView getOrCreateFeatureView(String name, Query query, Integer version) throws FeatureStoreException, IOException Get feature view metadata object or create a new one if it doesn't exist. This method doesn't update existing feature view metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureView fv = fs.getOrCreateFeatureView("fv_name", query, 1);- Parameters:
name- Name of the feature view.query- Query object.version- Version of the feature view.- Returns:
- FeatureView The feature view metadata object.
- Throws:
FeatureStoreException- If unable to retrieve FeatureView from the feature store.IOException- Generic IO exception.
-
getOrCreateFeatureView
public FeatureView getOrCreateFeatureView(String name, Query query, Integer version, String description, List<String> labels) throws FeatureStoreException, IOException Get feature view metadata object or create a new one if it doesn't exist. This method doesn't update existing feature view metadata.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureView fv = fs.getOrCreateFeatureView("fv_name", query, 1, description, labels); "datetime");- Parameters:
name- Name of the feature view.query- Query object.version- Version of the feature view.description- Description of the feature view.labels- List of label features.- Returns:
- FeatureView The feature view metadata object.
- Throws:
FeatureStoreException- If unable to retrieve FeatureView from the feature store.IOException- Generic IO exception.
-
getFeatureView
public FeatureView getFeatureView(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException Get a feature view object from the selected feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureView fv = fs.getFeatureView("fv_name", 1);- Specified by:
getFeatureViewin classFeatureStoreBase<Query>- Parameters:
name- Name of the feature view.version- Version to get.- Returns:
- FeatureView The feature view metadata object.
- Throws:
FeatureStoreException- If unable to retrieve FeatureView from the feature store.IOException- Generic IO exception.
-
getFeatureView
Get a feature view object with the default version `1` from the selected feature store.// get feature store handle FeatureStore fs = HopsworksConnection.builder().build().getFeatureStore(); FeatureView fv = fs.getFeatureView("fv_name");- Specified by:
getFeatureViewin classFeatureStoreBase<Query>- Parameters:
name- Name of the feature view.- Returns:
- FeatureView The feature view metadata object.
- Throws:
FeatureStoreException- If unable to retrieve FeatureView from the feature store.IOException- Generic IO exception.
-
sql
-
createTrainingDataset
Deprecated. -
getTrainingDataset
@Deprecated public TrainingDataset getTrainingDataset(@NonNull @NonNull String name, @NonNull @NonNull Integer version) throws FeatureStoreException, IOException Deprecated.- Throws:
FeatureStoreExceptionIOException
-
getTrainingDataset
@Deprecated public TrainingDataset getTrainingDataset(String name) throws FeatureStoreException, IOException Deprecated.- Throws:
FeatureStoreExceptionIOException
-
getTrainingDatasets
@Deprecated public scala.collection.Seq<TrainingDataset> getTrainingDatasets(@NonNull @NonNull String name) throws FeatureStoreException, IOException Deprecated.- Throws:
FeatureStoreExceptionIOException
-