DEA-C02 · Question #142
DEA-C02 Question #142: Real Exam Question with Answer & Explanation
The correct answer is C: Use Snowpark to create User-Defined Functions (UDFs) based on the existing Scala code.. Snowpark is specifically designed to let developers use existing JVM-based languages (Scala, Java) and Python to write code that runs directly in Snowflake, making it the fastest migration path - the existing Scala logic can be wrapped into UDFs with minimal modification. Why the
Question
A company is running several machine learning models that were developed in Scala and are running on-premises. A Data Engineer has been asked to design a solution using Snowflake. What is the FASTEST way to migrate the models to Snowflake?
Options
- AConvert the Scala code to SQL and create new SQL User-Defined Functions (UDFs) in
- BCreate new Scala User-Defined Functions (UDFs) in Snowflake using the existing Scala code.
- CUse Snowpark to create User-Defined Functions (UDFs) based on the existing Scala code.
- DUse a Python function to create User-Defined Functions (UDFs) based on the existing Scala
Explanation
Snowpark is specifically designed to let developers use existing JVM-based languages (Scala, Java) and Python to write code that runs directly in Snowflake, making it the fastest migration path - the existing Scala logic can be wrapped into UDFs with minimal modification.
Why the distractors are wrong:
- A is wrong because converting Scala ML logic to SQL is time-consuming and often impractical - complex model logic doesn't translate cleanly to SQL.
- B is wrong (or at best incomplete) because while Snowflake does support Scala UDFs, creating them without Snowpark means manually rewriting the code to fit Snowflake's native UDF interface, which is more work than using Snowpark's DataFrame API.
- D is wrong because rewriting Scala code in Python introduces unnecessary effort and potential logic errors - you'd be switching languages entirely rather than reusing what you already have.
Memory tip: Think of Snowpark = Snow + Spark. Just as Apache Spark lets data engineers write JVM code (Scala/Java) for distributed processing, Snowpark brings that same "write in your language, run in the cloud" model into Snowflake - making it the bridge for migrating existing Scala workloads with the least friction.
Topics
Community Discussion
No community discussion yet for this question.