A transformation mode specifies the format in which a transformation needs to be written. For example, in spark_sql mode, a transformation needs to be written in SQL, while in pyspark mode, a transformation needs to be written using the PySpark DataFrame API.
This page describes the transformation modes that are supported by transformations defined inside and outside of Feature Views.
The examples show transformations defined inside of Feature Views.
Modes for Batch Feature Views and Stream Feature Views
mode="spark_sql" and mode="snowflake_sql"
Characteristic
Description
Summary
Contains a SQL query
Supported Feature View types
Batch Feature View, Stream Feature View. mode="snowflake_sql" is not supported in Stream Feature Views.
Supported data platforms
Databricks, EMR, Snowflake
Input type
A string (the name of a view generated by Tecton)
Output type
A string
Example
@batch_feature_view()...mode="spark_sql",...defuser_has_good_credit(credit_scores):returnf""" SELECT user_id, IF (credit_score > 670, 1, 0) as user_has_good_credit, date as timestamp FROM{credit_scores} """
@batch_feature_view(...mode="snowflake_sql",...)defuser_has_good_credit(credit_scores):returnf""" SELECT user_id, IFF (credit_score > 670, 1, 0) as user_has_good_credit, date as timestamp FROM{credit_scores} """
mode="pyspark"
Characteristic
Description
Summary
Contains Python code that is executed within a Spark context.