typeof function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Return a DDL-formatted type string for the data type of the input.

Syntax

typeof(expr)

Arguments

  • expr: Any expression.

Returns

A STRING.

Examples

> SELECT typeof(1);
 int
> SELECT typeof(array(1));
 array<int>