SOL-C01 · Question #254
A data scientist is working on a machine learning project using Snowflake Notebooks. They have a dataset stored in Snowflake and need to perform feature engineering. They want to write a Python functi
Sign in or unlock SOL-C01 to reveal the answer and full explanation for question #254. The question stem and answer options stay visible for context.
Question
A data scientist is working on a machine learning project using Snowflake Notebooks. They have a dataset stored in Snowflake and need to perform feature engineering. They want to write a Python function that takes a Snowflake table name and a list of SQL expressions as input, executes these expressions against the table, and returns a Pandas DataFrame containing the new features. Which approach is MOST suitable for creating and executing this function within a Snowflake Notebook, minimizing data transfer outside of Snowflake?
Options
- AUse the `snowflake.connectors library to connect to Snowflake, execute each SQL expression
- BUse the `snowflake.snowpark.functions.call_udf to call a UDF from Snowflake notebooks and
- CCreate a Snowflake User-Defined Function (UDF) that encapsulates the feature engineering logic,
- DUse the Snowflake web UI to create a view containing the feature engineered data. Load that view
- EUtilize the `sqlalchemy' library to establish a connection to Snowflake, construct the SQL query
Unlock SOL-C01 to see the answer
You've previewed enough free SOL-C01 questions. Unlock SOL-C01 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.