id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
snowflake_docs/metering_daily_history_0_0.txt
/ Schema:
snowflake_docs/try_to_geometry_6_0.txt
Usage Notes ¶ * Returns NULL if the input cannot be parsed as the appropriate supported format (WKT, WKB, EWKT, EWKB, GeoJSON). * For GeoJSON, WKT, and WKB input, if the ` _ srid _ ` argument is not specified, the resulting GEOMETRY object has the SRID set to 0.
snowflake_docs/regr_valx_2_0.txt
Syntax ¶ REGR_VALX( <y> , <x> ) Copy
snowflake_docs/system_database_refresh_progress_3_0.txt
Arguments ¶ ` _ secondary_db_name _ ` Name of the secondary database. This argument is optional if the secondary database is the active database in the current session. Note that the entire name must be enclosed in single quotes. ` _ query_id _ ` ID of the database refresh query. The query ID can be obtained from ...
snowflake_docs/create-external-table_11_1.txt
LSE ` ` ESCAPE_UNENCLOSED_FIELD = ' _ character _ ' | NONE ` A singlebyte character string used as the escape character for unenclosed field values only. An escape character invokes an alternative interpretation on subsequent characters in a character sequence. You can use the ESCAPE character to interpret inst...
snowflake_docs/call-with_21_0.txt
Examples ¶ The following example creates and calls a procedure, specifying the arguments by position: WITH copy_to_table AS PROCEDURE (fromTable STRING, toTable STRING, count INT) RETURNS STRING LANGUAGE SCALA RUNTIME_VERSION = '2.12' PACKAGES = ('com.snowflake:snowpark:latest') HAN...
snowflake_docs/call-with_1_0.txt
CALL (with Anonymous Procedure) ¶ Creates and calls an anonymous procedure that is like a [ stored procedure not stored for later use. With this command, you both create an anonymous procedure defined by parameters in the WITH clause and call that procedure. You need not have a role with CREATE PROCEDURE schema priv...
snowflake_docs/snowflake-db-classes_12_0.txt
Available Classes ¶ For a list of available Snowflake classes, see [ SQL Class Reference
snowflake_docs/date-time-input-output_3_0.txt
Session Parameters for Dates, Times, and Timestamps ¶ A set of session parameters determines how date, time, and timestamp data is passed into and out of Snowflake, as well as the time zone used in the time and timestamp formats that support time zones. The parameters can be set at the account, user, and session lev...
snowflake_docs/st_xmin_4_0.txt
Returns ¶ Returns a REAL value.
snowflake_docs/alter-packages-policy_9_0.txt
Examples ¶ The following example updates the packages policy. > > ALTER PACKAGES POLICY packages_policy_prod_1 SET ALLOWLIST = > ('pandas==1.2.3'); > > > Copy Was this page helpful? Yes No Inc. All Rights Reserved . On this page 1. Syntax 2. Parameters 3. Access Control Requirements 4. Usage Note...
snowflake_docs/nth_value_3_0.txt
Arguments ¶ ` _ n _ ` This specifies which value of N to use when looking for the Nth value. ` _ expr _ ` The expression that determines the return value. ` _ expr1 _ ` The expression by which to partition the rows. You can specify a single expression or a comma-separated list of expressions. For example: PAR...
snowflake_docs/left_3_0.txt
Arguments ¶ ` _ string_expr _ ` This must be a ` VARCHAR ` or ` BINARY ` value. ` _ length_expr _ ` The length should be an expression that evaluates to an integer. It should specify: * The number of UTF-8 characters to return if the input is ` VARCHAR ` . * The number of bytes to return if the input is ` ...
snowflake_docs/schemata_0_0.txt
/ Schema:
snowflake_docs/pipe_usage_history_1_0.txt
PIPE_USAGE_HISTORY view ¶ This Account Usage view can be used to query the history of data loaded into intro) within the last 365 days (1 year). The view displays the history of data loaded and credits billed for your entire Snowflake account.
snowflake_docs/decrypt_0_0.txt
/ encryption) DECRYPT Categories:
snowflake_docs/add_regex_1_0.txt
` _ custom_classifier _ ` !ADD_REGEX ¶ Available to all Snowflake accounts that are [ Enterprise Edition Custom Classification requires Enterprise Edition (or higher). To inquire about upgrading, please contact [ Snowflake Support Snowflake-Lodge) . See also: custom.html
snowflake_docs/asof-join_11_0.txt
Numbers as Timestamps ¶ The following example demonstrates that the match condition can compare numeric values. In this case, the tables have UNIX timestamp values stored in NUMBER(38,0) columns. ` 1696150805 ` is equivalent to ` 2023-10-30 10:20:05.000 ` (three seconds later than ` 1696150802 ` ). SELECT * F...
snowflake_docs/create-hybrid-table_2_0.txt
label-hybrid-table-limitations-regions) . Creates a new hybrid table in the current/specified schema or replaces an existing table. A table can have multiple columns, with each column definition consisting of a name, data type, and optionally whether the column: * Requires a NOT NULL value. * Has a default value o...
snowflake_docs/data-type-conversion_3_0.txt
Explicit Casting vs Implicit Casting ¶ Users can explicitly convert a value from one data type to another. This is called _explicit casting_ . In some situations, Snowflake converts a value to another data type automatically. This is called _implicit casting_ or _coercion_ .
snowflake_docs/sha1_binary_4_0.txt
Returns ¶ The data type of the returned value is BINARY.
snowflake_docs/grant-database-role-share_4_0.txt
Usage notes ¶ * Granting a database role to a share fails if any DDL or other restricted privilege was granted to the database role. A database role can only grant permissions for read-only activity on a database and its objects. * A shared database role does not support future grants. Snowflake returns the fol...
snowflake_docs/array_intersection_1_0.txt
ARRAY_INTERSECTION ¶ Returns an array that contains the matching elements in the two input arrays. The function is NULL-safe, meaning it treats NULLs as known values for comparing equality. See also:
snowflake_docs/grant-ownership_7_0.txt
Roles ¶ Revoke all outbound privileges on the ` mydb ` database, currently owned by the ` manager ` role, before transferring ownership to the ` analyst ` role: > > REVOKE ALL PRIVILEGES ON DATABASE mydb FROM ROLE manager; > > GRANT OWNERSHIP ON DATABASE mydb TO ROLE analyst; > > GRANT ALL PRIVILE...
snowflake_docs/get_absolute_path_4_0.txt
Returns ¶ Absolute path of the file in cloud storage.
snowflake_docs/validate_pipe_load_1_0.txt
VALIDATE_PIPE_LOAD ¶ This table function can be used to validate data files processed by [ Snowpipe The function returns details about any errors encountered during an attempted data load into Snowflake tables. Note This function returns pipe activity within the last 14 days.
snowflake_docs/system_get_privatelink_4_0.txt
Usage notes ¶ * Only account administrators (i.e. users with the ACCOUNTADMIN role) can execute this function. * This function can be used with Snowflake accounts on AWS or Azure; Google Cloud Platform (GCP) is not currently supported.
snowflake_docs/alter-service_4_0.txt
Access control requirements ¶ access-control-overview-roles) used to execute this SQL command must have the overview.html
snowflake_docs/alter-authentication-policy_7_0.txt
label-access-control-securable-objects) , see [ Overview of
snowflake_docs/while_0_0.txt
/ snowflake-scripting) WHILE
snowflake_docs/system_clustering_information_1_0.txt
SYSTEM$CLUSTERING_INFORMATION ¶ Returns clustering information, including average clustering depth, for a table based on one or more columns in the table. See also:
snowflake_docs/build_scoped_file_url_4_0.txt
Returns ¶ The function returns a scoped URL in the following format: https://<account_identifier>/api/files/<query_id>/<encoded_file_path> Copy Where: ` account_identifier ` Hostname of the Snowflake account for your stage. The hostname starts with a Snowflake-provided account locator and ends with the Snowflak...
snowflake_docs/as_boolean_5_0.txt
Examples ¶ Here is a simple example of using ` AS_BOOLEAN ` : > > SELECT AS_BOOLEAN(TO_VARIANT(TRUE)), AS_BOOLEAN(TO_VARIANT(FALSE)), > AS_BOOLEAN(TO_VARIANT(NULL)); > > +------------------------------+-------------------------------+------------------------------+ > | AS_BOOLEAN(TO_VARIANT(TRUE)) | AS_BOOL...
snowflake_docs/date-time-examples_14_0.txt
Calculating Differences Between Dates or Times ¶ Calculate the difference between the current date and the date in three years: SELECT DATEDIFF(year, current_date(), DATEADD(year, 3, current_date() ) ); Copy Calculate the difference between the current date and the date in three months: SELECT DATEDIFF...
snowflake_docs/st_geographyfromwkb_7_0.txt
label-data-types-geography) .
snowflake_docs/show-application-packages_0_0.txt
/ 1. APPLICATION 7. APPLICATION PACKAGE 12. APPLICATION ROLE 19. Additional Commands SHOW APPLICATION PACKAGES
snowflake_docs/policy_context_0_0.txt
/ 1. General 14. Session 29. Session Object 41. Alert context) POLICY_CONTEXT Categories:
snowflake_docs/match_recognize_0_0.txt
/ Categories:
snowflake_docs/show-grants_2_0.txt
Syntax ¶ SHOW GRANTS [ LIMIT <rows> ] SHOW GRANTS ON ACCOUNT [ LIMIT <rows> ] SHOW GRANTS ON <object_type> <object_name> [ LIMIT <rows> ] SHOW GRANTS TO { APPLICATION <app_name> | APPLICATION ROLE [ <app_name>. ]<app_role_name> | <class_name> ROLE <instance_name>!<instance_role_name...
snowflake_docs/arrays_to_object_0_0.txt
/ 1. JSON and XML Parsing 9. Array/Object Creation and Manipulation 43. Map Creation and Manipulation 51. Extraction 58. Conversion/Casting 82. Type Predicates Categories: semistructured) (Array/Object)
snowflake_docs/regexp_replace_6_0.txt
Collation Details ¶ Arguments with collation specifications are currently not supported.
snowflake_docs/create-notification-integration_7_0.txt
Cloud Provider Parameters for Push Notifications ( ` cloudProviderParamsPush ` ) ¶ **Amazon Simple Notification Service** > ` NOTIFICATION_PROVIDER = AWS_SNS ` > > > Specifies Amazon Simple Notification Service (SNS) as the third-party cloud > message queuing service. > > ` AWS_SNS_TOPIC_ARN = '<topic_arn>' ...
snowflake_docs/substr_6_0.txt
Collation Details ¶ * Collation applies to ` VARCHAR ` inputs. Collation does not apply if the input data type of the first parameter is ` BINARY ` . * No impact. Although collation is accepted syntactically, collations have no impact on processing. For example, languages with two-character and three-characte...
snowflake_docs/parameters_63_0.txt
MULTI_STATEMENT_COUNT ¶ Type : Session — Can be set for Account » User » Session Data Type : Integer (Constant) Clients : SQL API, JDBC, .NET, ODBC Description : Number of statements to execute when using the multi-statement capability. Values : ` 0 ` : Variable number of statements. ` 1 ` : One statement. Mo...
snowflake_docs/drop-warehouse_4_0.txt
Usage Notes ¶ * Dropped warehouses cannot be recovered; they must be recreated. * When this command is issued, Snowflake aborts any queries being processed by the specified warehouse and immediately shuts down the compute resources utilized by the warehouse. This prevents the warehouse from consuming any more S...
snowflake_docs/functions-regexp_10_0.txt
Specifying Regular Expressions in Single-Quoted String Constants ¶ If you are using a regular expression in a [ single-quoted string constant any backslashes in backslash-sequences with a second backslash. Note To avoid escaping backslashes in a regular expression, you can use a dollar- quoted string constant , ...
snowflake_docs/commands-replication_2_0.txt
Failover ¶
snowflake_docs/show-authentication-policies_0_0.txt
/ 1. Authentication Policy 7. Network Policy 13. Network Rule 19. Packages Policy 25. Password Policy 31. Session Policy 37. Secret AUTHENTICATION POLICIES
snowflake_docs/last_successful_scheduled_time_5_0.txt
Returns ¶ TIMESTAMP_LTZ value that represents when the most recent successful evaluation of the alert condition was scheduled, or NULL if there are no recent successful evaluations of the alert condition.
snowflake_docs/object_construct_6_1.txt
| "dataset_size": 2, > | > | "distinct_province": 2, > | > | "foo": 1234567 > | > | } > | > > +-------------------------------------------------------------------------------+ > > > Copy Was this page helpful? Yes No Inc. All Rights Reserved . On this page 1. Syntax 2. Returns 3. Usage N...
snowflake_docs/desc-database_5_0.txt
Examples ¶ This demonstrates the DESCRIBE DATABASE command: CREATE DATABASE desc_demo; CREATE SCHEMA sample_schema_1; CREATE SCHEMA sample_schema_2; DESCRIBE DATABASE desc_demo; Copy +-------------------------------+--------------------+--------+ | created_on | name ...
snowflake_docs/create-function_38_0.txt
All Languages ¶ * ` _ function_definition _ ` has size restrictions. The maximum allowable size is subject to change. * The delimiters around the ` _ function_definition _ ` can be either single quotes or a pair of dollar signs. Using ` $$ ` as the delimiter makes it easier to write functions that contain s...
snowflake_docs/data-types-geospatial_10_0.txt
Specifying the Output Format for Result Sets ¶ geography-output-format) and [ GEOMETRY_OUTPUT_FORMAT GEOGRAPHY- and GEOMETRY-typed columns in result sets (respectively). The GEOGRAPHY_OUTPUT_FORMAT and GEOMETRY parameters can have one of the following values: > Parameter Value > > | > > Description > > ---|--- ...
snowflake_docs/rollback_3_0.txt
Parameters ¶ ` WORK ` Optional keyword that provides compatibility with other database systems.
snowflake_docs/alter-session-policy_7_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/references_1_0.txt
Using references to authorize access on objects ¶ notes/preview-features) — Open Available to all accounts. A reference can be used to authorize access on objects to a stored procedure, application, or class instance that does not have access to those objects by default.
snowflake_docs/boolxor_agg_6_0.txt
Examples ¶ The following example shows that boolxor_agg returns true when exactly one of the input values is true. > Create and load the table: > > > create or replace table test_boolean_agg( > id integer, > c1 boolean, > c2 boolean, > c3 boolean, > c4 boolean > ...
snowflake_docs/array_construct_compact_2_0.txt
Syntax ¶ ARRAY_CONSTRUCT_COMPACT( [ <expr1> ] [ , <expr2> [ , ... ] ] ) Copy
snowflake_docs/ntile_1_0.txt
NTILE ¶ Divides an ordered data set equally into the number of buckets specified by ` _ constant_value _ ` . Buckets are sequentially numbered 1 through ` _ constant_value _ ` .
snowflake_docs/undrop-schema_4_0.txt
Usage Notes ¶ * Restoring schemas is only supported in the current database, even if the schema name is fully-qualified schema name. * If a schema with the same name already exists, an error is returned.
snowflake_docs/external_functions_history_2_0.txt
Syntax ¶ EXTERNAL_FUNCTIONS_HISTORY( [ DATE_RANGE_START => <constant_date_expression> ] [, DATE_RANGE_END => <constant_date_expression> ] [, FUNCTION_SIGNATURE => '<string>' ] ) Copy
snowflake_docs/map_keys_2_0.txt
Syntax ¶ MAP_KEYS( <map> ) Copy
snowflake_docs/drop-projection-policy_7_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/create-external-table_7_1.txt
Storage : [ Refreshing external tables automatically for Google Cloud Storage * Microsoft Azure : [ Refreshing external tables automatically for Azure Blob Storage * When an external table is created, its metadata is refreshed automatically once unless ` REFRESH_ON_CREATE = FALSE ` . ` TRUE ` Snowflake ...
snowflake_docs/applicable_roles_0_0.txt
/
snowflake_docs/show-packages-policies_1_0.txt
SHOW PACKAGES POLICIES ¶ Lists packages policy information.
snowflake_docs/name-resolution_3_0.txt
Resolution When Schema Omitted (Double-Dot Notation) ¶ > ` (''<database_name>..<object_name>'') ` The two dots indicate that the schema name is not specified. The PUBLIC default schema is always referenced. Note that this notational format is provided mostly for compatibility with other systems, such as Microsoft S...
snowflake_docs/system_typeof_1_0.txt
SYSTEM$TYPEOF ¶ Returns a string representing the SQL data type associated with an expression. See also:
snowflake_docs/functions-analytic_22_2.txt
10 | | 100 | 2 | 30 | 3 | 45 | 15.000000 | 5 | 30 | | 100 | 2 | 5 | 3 | 45 | 15.000000 | 5 | 30 | | 100 | 3 | 11 | 5 | 176 | ...
snowflake_docs/binary-input-output_5_0.txt
Details of base64 Encoding ¶ Each group of three 8-bit bytes (a total of 24 bits) of binary data is re- arranged into four groups of 6 bits each (still 24 bits). Each of the 64 possible combinations of 6 bits is represented by one of the following 64 printable ASCII characters: * uppercase letters (A - Z) * low...
snowflake_docs/array_unique_agg_2_0.txt
Syntax ¶ ARRAY_UNIQUE_AGG( <column> ) Copy
snowflake_docs/array_construct_4_0.txt
Returns ¶ The data type of the returned value is ` ARRAY ` .
snowflake_docs/operators-arithmetic_2_0.txt
List of Arithmetic Operators ¶ Operator | Syntax | Description ---|---|--- ` + ` (unary) | ` +a ` | Returns ` a ` , which will cause implicit conversion of ` a ` to a numeric value. If ` a ` is a string, but the string cannot be converted to a numeric value, an error is returned. ` + ` | ` a + b ` | A...
snowflake_docs/date-time-examples_5_0.txt
Converting Timestamps to Alternative Time Zones ¶ In the following example, a set of timestamp values is stored with no time zone data. The timestamps are loaded in UTC time and converted to other time zones: ALTER SESSION SET TIMEZONE = 'UTC'; ALTER SESSION SET TIMESTAMP_LTZ_OUTPUT_FORMAT = 'YYYY-MM-DD HH24...
snowflake_docs/arrays_overlap_4_0.txt
Examples ¶ Here are some examples: > > SELECT ARRAYS_OVERLAP(array_construct('hello', 'aloha'), > array_construct('hello', 'hi', 'hey')) > AS Overlap; > +---------+ > | OVERLAP | > |---------| > | True | > +---------+ > SELECT ARRAYS_OVERLAP(array_constr...
snowflake_docs/undrop-tag_0_0.txt
/ 1. Column-level Security 7. Row Access Policy 13. Tag UNDROP TAG
snowflake_docs/comment_2_0.txt
Syntax ¶ COMMENT [IF EXISTS] ON <object_type> <object_name> IS '<string_literal>'; COMMENT [IF EXISTS] ON COLUMN <table_name>.<column_name> IS '<string_literal>'; Copy
snowflake_docs/show-external-functions_0_0.txt
/ 1. User Defined Function 7. External Function 13. Stored Procedure 21. Snowflake Scripting function) SHOW EXTERNAL FUNCTIONS
snowflake_docs/random_2_0.txt
Syntax ¶ RANDOM([seed]) Copy
snowflake_docs/grant-database-role_7_0.txt
label-access-control-securable-objects) , see [ Overview of
snowflake_docs/copy-into-location_2_0.txt
Syntax ¶ COPY INTO { internalStage | externalStage | externalLocation } FROM { [<namespace>.]<table_name> | ( <query> ) } [ PARTITION BY <expr> ] [ FILE_FORMAT = ( { FORMAT_NAME = '[<namespace>.]<file_format_name>' | TYPE = { CSV | JSON | PARQUET } [ formatTypeOptions ] }...
snowflake_docs/grant-application-role_1_0.txt
GRANT APPLICATION ROLE ¶ Available This feature is not supported on Google Cloud Platform. Assigns an application role to an account role or another application role. This command creates a “parent-child” relationship between the application role and the role to which it is granted, also referred to as a role hierar...
snowflake_docs/task_versions_0_0.txt
/ Schema:
snowflake_docs/desc-search-optimization_0_0.txt
/ 2. Table 13. Dynamic Table 19. Event Table 24. External Table 30. Hybrid Table 36. Iceberg Table 43. View 49. Materialized View 56. Sequence DESCRIBE SEARCH OPTIMIZATION
snowflake_docs/create-table_21_0.txt
label-managed-access-schemas) , only the schema owner (i.e. the role with the OWNERSHIP privilege on the schema) or a role with the MANAGE GRANTS privilege can grant or revoke privileges on objects in the schema, including future grants. Note that operating on any object in a schema also requires the USAGE privilege ...
snowflake_docs/log_0_0.txt
/ 1. Arithmetic 4. Rounding and Truncation 13. Exponent and Root 21. Logarithmic 24. Trigonometric 42. Other numeric) LOG Categories:
snowflake_docs/split_to_table_2_0.txt
Syntax ¶ SPLIT_TO_TABLE(<string>, <delimiter>) Copy
snowflake_docs/data-types-semistructured_23_1.txt
| >> +----+-------------+---------------------+--------------------------+ >> >> >> Copy For additional semi-structured data usage examples, see [ Querying Semi- Was this page helpful? Yes No Inc. All Rights Reserved . On this page 1. VARIANT 2. OBJECT 3. ARRAY 4. Examples Re...
snowflake_docs/network_policies_0_0.txt
/ Schema:
snowflake_docs/object_keys_4_0.txt
Returns ¶ data-type-array) containing the keys. function returns an ARRAY(VARCHAR).
snowflake_docs/copy-files_9_0.txt
label-access-control-securable-objects) , see [ Overview of
snowflake_docs/create-tag_9_0.txt
label-access-control-securable-objects) , see [ Overview of For additional details on tag DDL and privileges, see [ Managing tags
snowflake_docs/select_17_0.txt
Selecting All Columns and Renaming One Column ¶ This example shows how to select all columns in ` employee_table ` and rename the ` department_id ` column: SELECT * RENAME department_id AS department FROM employee_table; Copy +-------------+------------+------------+------------+ | EMPLOYEE_ID | LAST_N...
snowflake_docs/bitor_agg_1_0.txt
BITOR_AGG ¶ Returns the bitwise OR value of all non-NULL numeric records in a group. For each bit position, if at least one row has the bit set to 1, then the bit is set to 1 in the result. If all rows have that bit set to zero, the result is zero. If all records inside the group are NULL, or if the group is empty, ...
snowflake_docs/commands-security_1_0.txt
Security Commands ¶ Security commands enable you to manage your security environment.
snowflake_docs/translate_0_0.txt
/ 1. General Manipulation 34. Case Conversion 38. Regular Expression Matching 48. Other Matching/Comparison 66. Compression/Decompression 70. Encoding/Decoding 81. Cryptographic/Checksum 93. Hash (Non-cryptographic) 96. Co...
snowflake_docs/show-classes_3_0.txt
Parameters ¶ ` LIKE ' _ pattern _ ' ` Optionally filters the command output by object name. The filter uses case- insensitive pattern matching, with support for SQL wildcard characters ( ` % ` and ` _ ` ). For example, the following patterns return the same results: ` ... LIKE '%testing%' ... ` ` ... L...
snowflake_docs/insert-multi-table_6_0.txt
Examples ¶
snowflake_docs/desc-compute-pool_10_0.txt
Examples ¶ The following example describes the compute pool named ` tutorial_compute_pool ` : DESCRIBE COMPUTE POOL tutorial_compute_pool; Copy Sample output: +-----------------------+--------+-----------+-----------+-----------------+--------------+----------+-------------------+-------------+--------------...
snowflake_docs/desc-network-rule_3_0.txt
Parameters ¶ ` _ name _ ` Specifies the identifier for the network rule you want to describe. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are case-sensitive.