Question 1
BeginnerSnowpark Concepts · Outline Snowpark architecture
A data engineer writes a Snowpark Python script that connects to Snowflake, initializes a DataFrame via df = session.table("SALES"), applies a filter df = df.filter(col("AMOUNT") > 1000), and adds a new column df = df.with_column("TAX", col("AMOUNT") * 0.1). After executing these lines in a Jupyter Notebook, the engineer checks the Snowflake Query History but sees no queries corresponding to these operations. What is the primary reason for this behavior?
Answer and explanation
Correct answer: A
Snowpark operations on DataFrames use lazy evaluation. Transformations (like filter, select, with_column) only build up a logical query plan on the client side. The actual SQL query is not compiled, sent, or executed on the Snowflake virtual warehouse until an action method (such as .show(), .collect(), .count(), or .save_as_table()) is called to evaluate the DataFrame.
