Snowflake interview questions

16. What is snowflakes User-defined functions ?
User-defined functions (UDFs) let you extend the system to perform operations that are not available through the built-in, system-defined functions provided by Snowflake. Snowflake currently supports two types of UDFs, SQL and JavaScript: A SQL UDF evaluates an arbitrary SQL expression and returns either scalar or tabular results. A JavaScript UDF lets you use the JavaScript programming language to manipulate data and return either scalar or tabular results.

17. What is an External Function in Snowflake ?
An external function calls code that executes outside Snowflake; the executed code is known as a remote service. Users can write and call their own remote services, or call remote services written by third parties. These remote services can be written using any HTTP server stack, including cloud serverless compute services such as AWS Lambda. From the perspective of a user running a SQL statement, an external function behaves like any other scalar function. A SQL statement performs the following actions: Calls the function, optionally passing parameters. Receives a value back from the function.

18. Advantages of External Functions over UDFs in Snowflake ?
External functions have the following advantages over other UDFs (user-defined functions):
The code for the remote service can be written in languages that other UDFs cannot be written in, including:
Python
Go
C#

19. What is the INFORMATION_SCHEMA Schema?
Each database created in your account automatically includes a built-in, read-only schema named INFORMATION_SCHEMA. The schema contains the following objects: Views for all the objects contained in the database, as well as views for account-level objects (i.e. non-database objects such as roles, warehouses, and databases) . Table functions for historical and usage data across your account.

20. How to retrieve the list of all external tables in all schemas in the mydatabase database ?
select * from mydatabase.information_schema.external_tables;

Author: user

Leave a Reply

Your email address will not be published. Required fields are marked *