Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
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.
To derive the type of a VARIANT value, use the schema_of_variant function function.
To derive the combined schema of a group of VARIANT values, use the schema_of_variant_agg aggregate function aggregate function.
Examples
> SELECT typeof(1);
int
> SELECT typeof(array(1));
array<int>
> SELECT typeof(123.4::VARIANT);
variant
> SELECT schema_of_variant(123.4::VARIANT);
DECIMAL(4,1)
> SELECT typeof('hello' COLLATE UTF8_LCASE);
string collate UTF8_LCASE