QuestionQ36

Transform Data

A Data Engineer has created two SQL User-Defined Functions (UDFs) that share the same name:

Question Image

The following function call is executed:

select plus5(to_date(‘2024-01-25’));  

What is the output of this call?

Explanation

Snowflake resolves the DATE argument to the VARCHAR overload because DATE-to-NUMBER conversion is unsupported, while DATE can be implicitly converted to a string. The string UDF concatenates 5 to the date representation, yielding 2024-01-255.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!