Template specification¶
Defines a single template in a collaboration. Templates are registered by calling REGISTER_TEMPLATE with the template specification.
Schema:
api_versionThe version of the Collaboration API used. Must be
2.0.0.spec_typeSpecification type identifier. Must be
template.name: template_nameA unique, user-friendly name for this template. Must follow Snowflake identifier rules with a maximum of 75 characters. The
name_versionpair must be unique for all templates in this account.version: version_stringA version identifier for this template (maximum 20 characters). Must follow Snowflake identifier rules. The version string is given its own column in the response to VIEW_TEMPLATES and VIEW_REGISTERED_TEMPLATES, so use a value that can be sorted by increasing value. Example:
V0typeThe template type. One of the following values:
sql_analysis: Template for data analysis operations.sql_activation: Template for data activation operations.
description: template_description(Optional)A high-level description of what this template does (maximum 1,000 characters).
methodology: methodology_description(Optional)A more detailed description of how this template works (maximum 1,000 characters).
parameters(Optional)The list of all user-provided parameters in this template. Each item can have the following fields:
name: Parameter name as a valid Snowflake identifier, max 255 characters.description(Optional): Human-readable description of the parameter (maximum 500 characters).required(Optional): Whether the parameter is required. Default isfalse.default(Optional): Default value for the parameter, which can be any data type.type(Optional): Expected data type of the parameter. One of:string,integer,number,boolean,array, orobject.
code_specs(Optional)One or more code bundles that define any functions referenced by this template. Required when the template calls custom functions. Code spec IDs are versioned; if you want to access a new version of a function, you must update the code spec ID here, but not in the template itself, which calls the unversioned function name. The code spec name must have an underscore in it, and match the regular expression pattern
[A-Za-z]\w{0,74}_\w{1,20}.templateThe template content. For SQL templates, this contains the JinjaSQL template. For more information, see Template design.
The column names exposed to the template are determined by the
categoryandcolumn_typevalues for the column in the data offering specification. For more information, see Source column renaming.