GENERATE_COLUMN_DESCRIPTION

functionsupportedData loading & unloading

docs.snowflake.com ↗

Metadata functions

Generates a list of columns from a set of staged files that contain semi-structured data using the INFER_SCHEMA function output. The output from this function can be used as input when manually creating a table, external table, Apache Iceberg™ table, or view (using the appropriate CREATE <object> command) based on the column definitions of the staged files. Alternatively, the CREATE TABLE or CREATE ICEBERG TABLE command with the USING TEMPLATE clause can be used to create a new table with the column definitions derived from the same INFER_SCHEMA function output.

Syntax

GENERATE_COLUMN_DESCRIPTION( <expr> , '<string>' )

Parameters

NameRequiredDescription
exprrequiredOutput of the INFER_SCHEMA function formatted as an array.
'string'requiredType of object that could be created from the column list. The appropriate formatting for this type is applied to the output. Possible values are table, external_table, or view.

Returns

The function returns the list of columns in a set of staged files, which can be used as input when creating an object of the type identified in the second argument.