ANY TYPE

Translation specification for BigQuery's ANT TYPE data type

Description

The following is an excerpt of information about the usage of ANY TYPE within CREATE FUNCTION statements.

A parameter with a type equal to ANY TYPE can match more than one argument type when the function is called.

  • If more than one parameter has type ANY TYPE, then BigQuery doesn't enforce any type relationship between these arguments.

  • The function return type cannot be ANY TYPE. It must be either omitted, which means to be automatically determined based on sql_expression, or an explicit type.

  • Passing the function arguments of types that are incompatible with the function definition results in an error at call time.

Sample source patterns

Type definition for UDFs

ANY TYPE can only be found as the type for a function's parameter. SnowConvert automatically translates ANY TYPE to VARIANT.

-- INPUT
CREATE OR REPLACE FUNCTION FOO(parameter_1 ANY TYPE)
AS
  SELECT * FROM table_1;
-- OUTPUT
CREATE OR REPLACE FUNCTION FOO(parameter_1 VARIANT)
AS
$$
  SELECT * FROM table_1
$$

Last updated