Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 2.2.2 instead.

SageMaker FeatureStore PySpark

SageMaker FeatureStore Spark is an open source Spark library for Amazon SageMaker FeatureStore. With this connector, you can easily ingest data to FeatureGroup's online and offline store from Spark DataFrame. This package provides the Python (PySpark) interface.

For full documentation including Scala usage, cross-account Lake Formation access, and troubleshooting, see the GitHub repository.

Supported Versions

Component Supported Versions
Spark 3.1, 3.2, 3.3, 3.4, 3.5
Python 3.8, 3.9, 3.10, 3.11, 3.12
EMR emr-7.x and above

Note: Not all Python/PySpark combinations are supported. See the compatibility matrix below.

Python / PySpark Compatibility Matrix

Python \ PySpark 3.1 3.2 3.3 3.4 3.5
3.8 Yes Yes Yes Yes Yes
3.9 Yes Yes Yes Yes Yes
3.10 No Yes Yes Yes Yes
3.11 No No No Yes Yes
3.12 No No No Yes Yes

Note: PySpark versions older than 3.5 are in maintenance mode and will not receive new features. New functionality is only added for PySpark 3.5+.

Installation

Prerequisites: PySpark and NumPy must be installed in your environment.

The package is available on PyPI. It bundles pre-built JARs for each supported Spark version (3.1-3.5). At runtime, the correct JAR is automatically selected based on your installed PySpark version.

If SPARK_HOME is set, the installer copies the matching JAR into $SPARK_HOME/jars. For EMR, the path is handled automatically.

pip3 install sagemaker-feature-store-pyspark --no-binary :all:

EMR

Create a custom jar step to install the library:

  • Jar Location: command-runner.jar
  • Arguments: sudo -E pip3 install sagemaker-feature-store-pyspark --no-binary :all:

This installs the library on the Driver node only. To distribute to all executor nodes, create an installation script and add a custom bootstrap action when creating the EMR cluster.

Since bootstrap actions run before EMR applications are installed, dependent JARs cannot be automatically loaded to SPARK_HOME. When submitting your application, specify dependent JARs using:

--jars `feature-store-pyspark-dependency-jars`

SageMaker Notebook

SageMaker Notebook instances may use an older version of Spark. Install a compatible version first:

# Install a version of PySpark compatible with the library (3.1 - 3.5)
!pip3 install pyspark==3.5.1

Getting Started

FeatureStoreManager is the main interface for all library operations, including data ingestion and loading feature definitions.

Ingest Data

from feature_store_pyspark.FeatureStoreManager import FeatureStoreManager

feature_group_arn = "arn:aws:sagemaker:...:feature-group/your-feature-group"
feature_store_manager = FeatureStoreManager()
feature_store_manager.ingest_data(
    input_data_frame=df,
    feature_group_arn=feature_group_arn,
    target_stores=["OfflineStore"]
)

If target_stores is set to ["OfflineStore"], data is ingested directly to the offline store without using the FeatureStore Runtime API, reducing WCU costs. The default is None (ingests to both online and offline stores).

Load Feature Definitions

feature_definitions = feature_store_manager.load_feature_definitions_from_schema(df)

Returns feature definitions that can be used with the CreateFeatureGroup API.

Retrieve Failed Ingestion Records

failed_df = feature_store_manager.get_failed_stream_ingestion_data_frame()

Returns a DataFrame containing records that failed during ingest_data().

Lake Formation Support

When your offline store's S3 location is registered with AWS Lake Formation, enable the use_lake_formation_credentials parameter (requires PySpark 3.5+):

feature_store_manager.ingest_data(
    input_data_frame=df,
    feature_group_arn=feature_group_arn,
    target_stores=["OfflineStore"],
    use_lake_formation_credentials=True
)

For prerequisites, cross-account access, and troubleshooting, see the main repository README.

License

This project is licensed under the Apache-2.0 License.

Metadata

Release files for sagemaker-feature-store-pyspark 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sagemaker-feature-store-pyspark 2.2.0
File Size Uploaded
sagemaker_feature_store_pyspark-2.2.0.tar.gz 125.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sagemaker-feature-store-pyspark 2.2.0
File Interpreter ABI Platform
sagemaker_feature_store_pyspark-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 251.7 MB

Release files / sagemaker_feature_store_pyspark-2.2.0.tar.gz

Download URL sagemaker_feature_store_pyspark-2.2.0.tar.gz
Size 125.8 MB
Tags Source
SHA-256 checksum
How to use checksums
a01f97d23f2e10e1126832b06ccdb300df5ce335c4a4acbed710870d09b15280
BLAKE2b-256 checksum
How to use checksums
c151a79e7ffa82786af6a6b992e5e3c96ccb2cff8e4d7a1617ddb5bba18cbed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.20

Release files / sagemaker_feature_store_pyspark-2.2.0-py3-none-any.whl

Download URL sagemaker_feature_store_pyspark-2.2.0-py3-none-any.whl
Size 125.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
516b3e1dce3ff2152a11e0fab47547a7d8669aac992f173ba27392d59402c948
BLAKE2b-256 checksum
How to use checksums
bba69c391a62e0d8f80ac9e4011deffcf49bd4b2c73c837164a2cda845e95c91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.20

Release history Release notifications | RSS feed

2.2.2

2 release files

2.2.1

2 release files

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.2.0

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page