DEA-C02 · Question #10
DEA-C02 Question #10: Real Exam Question with Answer & Explanation
The correct answer is B: session.read.json(). In Snowpark, DataFrames are created through the Session object using lazy evaluation methods: session.read.json() (B) reads external data sources like JSON files into a DataFrame, session.table() (C) creates a DataFrame from an existing Snowflake table or view, and session.sql()
Question
Which methods can be used to create a DataFrame object in Snowpark? (Choose three.)
Options
- Asession.jdbc_connection()
- Bsession.read.json()
- Csession.table()
- DDataFrame.write()
- Esession.builder()
- Fsession.sql()
Explanation
In Snowpark, DataFrames are created through the Session object using lazy evaluation methods: session.read.json() (B) reads external data sources like JSON files into a DataFrame, session.table() (C) creates a DataFrame from an existing Snowflake table or view, and session.sql() (F) executes a SQL query and returns the result as a DataFrame - all three are standard entry points for DataFrame construction.
Why the distractors are wrong:
- A (
session.jdbc_connection()) - This doesn't exist in Snowpark; JDBC is a Java connectivity standard, not a Snowpark API method. - D (
DataFrame.write()) - This is used to write/save a DataFrame back to Snowflake (e.g., to a table), not to create one. - E (
session.builder()) -builderis used to construct and configure a Session, not to create a DataFrame from it.
Memory tip: Think "RST" - Read (file sources), Sql (query), Table (existing object). These are the three ways to pull data into a DataFrame via the Session. If it sounds like it's writing data out or setting something up, it's not creating a DataFrame.
Topics
Community Discussion
No community discussion yet for this question.