id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
snowflake_docs/create-file-format_5_0.txt
Format Type Options ( ` formatTypeOptions ` ) ¶ Depending on the file format type specified ( ` TYPE = ... ` ), you can include one or more of the following format-specific options (separated by blank spaces, commas, or new lines):
snowflake_docs/commands-table_4_0.txt
Dynamic Table ¶
snowflake_docs/data-type-conversion_2_0.txt
label-data-types-for-floating-point-numbers) . Converting a data type is called _casting_ .
snowflake_docs/list_9_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL control-overview.html
snowflake_docs/drop-service_6_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/anomaly_detection_12_0.txt
Syntax ¶ DROP SNOWFLAKE.ML.ANOMALY_DETECTION [IF EXISTS] <name>; Copy
snowflake_docs/parameters_54_0.txt
JDBC_TREAT_TIMESTAMP_NTZ_AS_UTC ¶ Type : Session — Can be set for Account » User » Session Data Type : Boolean Description : Specifies how JDBC processes TIMESTAMP_NTZ values. By default, when the JDBC driver fetches a value of type TIMESTAMP_NTZ from Snowflake, it converts the value to “wallclock” time using the...
snowflake_docs/summarize-snowflake-cortex_7_0.txt
label-cortex-llm-privileges) for more information on granting this privilege.
snowflake_docs/get_query_operator_stats_5_0.txt
Arguments ¶ ` _ query_id _ ` The ID of a query. You can use: * A string literal (a string surrounded by single quotes).
snowflake_docs/width_bucket_1_0.txt
WIDTH_BUCKET ¶ Constructs equi-width histograms, in which the histogram range is divided into intervals of identical size, and returns the bucket number into which the value of an expression falls, after it has been evaluated. The function returns an integer value or null (if any input is null).
snowflake_docs/hll_4_0.txt
Returns ¶ The data type of the returned value is INTEGER.
snowflake_docs/abs_2_0.txt
Syntax ¶ ABS( <num_expr> ) Copy
snowflake_docs/extract_answer-snowflake-cortex_8_0.txt
Example ¶ In this example, ` review_content ` is a column from the ` reviews ` table:. To extract an answer from each row of the table: SELECT SNOWFLAKE.CORTEX.EXTRACT_ANSWER(review_content, 'What dishes does this review mention?') FROM reviews LIMIT 10; Copy
snowflake_docs/create-stage_5_0.txt
Internal stage parameters ( ` internalStageParams ` ) ¶ ` [ ENCRYPTION = (TYPE = 'SNOWFLAKE_FULL' | TYPE = 'SNOWFLAKE_SSE') ] ` Specifies the type of encryption supported for all files stored on the stage. You cannot change the encryption type after you create the stage. ` TYPE = ... ` Specifies the en...
snowflake_docs/md5_number_lower64_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/create-security-integration-saml2_2_0.txt
Syntax ¶ CREATE [ OR REPLACE ] SECURITY INTEGRATION [ IF NOT EXISTS ] <name> TYPE = SAML2 ENABLED = { TRUE | FALSE } SAML2_ISSUER = '<string_literal>' SAML2_SSO_URL = '<string_literal>' SAML2_PROVIDER = '<string_literal>' SAML2_X509_CERT = '<string_literal>...
snowflake_docs/try_base64_decode_binary_7_0.txt
Examples ¶ This shows how to use the function ` TRY_BASE64_DECODE_BINARY ` . The function is used in the ` INSERT ` statement to decode a base64-encoded string into a BINARY field; the function is not used in the ` SELECT ` statement. > Create a table and insert data: > >> >> CREATE TABLE base64 (v VARCHAR,...
snowflake_docs/regexp_instr_9_1.txt
order by id; > > +----+-------------------------------------------------------------+-----------+----------+ > | ID | STRING1 | > SUBSTRING | POSITION | > > |----+-------------------------------------------------------------+-----------+----------| > | 2 |...
snowflake_docs/account-usage_0_0.txt
/
snowflake_docs/pow_2_0.txt
Syntax ¶ POW(x, y) POWER (x, y) Copy
snowflake_docs/regexp_substr_all_4_0.txt
label-regexp-parameters-argument) documentation. Default: ` c ` Note By default, REGEXP_SUBSTR_ALL returns the entire matching part of the subject. However, if the ` e ` (for “extract”) parameter is specified, REGEXP_SUBSTR_ALL returns the part of the subject that matches the first group in the pattern. If ` e ` is ...
snowflake_docs/current_date_1_0.txt
CURRENT_DATE ¶ Returns the current date of the system.
snowflake_docs/storage_daily_history_2_0.txt
Columns ¶ Column Name | Data Type | Description ---|---|--- SERVICE_TYPE | VARCHAR | The type of service, which can be one of ` STORAGE ` , ` STORAGE_READER ` . ACCOUNT_LOCATOR | VARCHAR | Locator for the account where the usage took place. ORGANIZATION_NAME | VARCHAR | Name of the organization where the u...
snowflake_docs/parameters_24_0.txt
CLIENT_PREFETCH_THREADS ¶ Type : Session — Can be set for Account » User » Session Data Type : Integer Clients : JDBC, ODBC, Python, .NET Description : Parameter that specifies the number of threads used by the client to pre-fetch large result sets. The driver will attempt to honor the parameter value, but defin...
snowflake_docs/data-types-datetime_15_0.txt
Interval Constants ¶ You can use interval constants to add or subtract a period of time to/from a date, time, or timestamp. Interval constants are implemented using the INTERVAL keyword, which has the following syntax: { + | - } INTERVAL '<integer> [ <date_time_part> ] [ , <integer> [ <date_time_part> ] ... ]' C...
snowflake_docs/create-security-integration_0_0.txt
/ 1. General 7. API 10. Catalog 15. External access 18. Notification 21. Security 25. Storage SECURITY INTEGRATION
snowflake_docs/is_database_role_in_session_3_0.txt
Arguments ¶ ` ' _ string_literal _ ' ` The name of the database role. Specify the relative name of the database role. The function evaluates to ` False ` if you specify the fully qualified name. ` _ column_name _ ` The column name in a table or view.
snowflake_docs/cos_0_0.txt
/ 1. Arithmetic 4. Rounding and Truncation 13. Exponent and Root 21. Logarithmic 24. Trigonometric 42. Other numeric) COS Categories:
snowflake_docs/data-types-semistructured_14_0.txt
Example of Inserting an OBJECT ¶ To insert OBJECT data directly, use IIS ( ` INSERT INTO ... SELECT ` ). function to construct the OBJECT that it inserts. > > INSERT INTO object_example (object_column) > SELECT OBJECT_CONSTRUCT('thirteen', 13::VARIANT, 'zero', > 0::VARIANT); > > > Copy The followin...
snowflake_docs/alter-external-volume_5_0.txt
Cloud provider parameters ( ` cloudProviderParams ` ) ¶ **Amazon S3** > ` STORAGE_PROVIDER = 'S3' ` > > > Specifies the cloud storage provider that stores your data files. > > ` STORAGE_AWS_ROLE_ARN = _ iam_role _ ` > > > Specifies the Amazon Resource Name (ARN) of the AWS identity and access > management...
snowflake_docs/system_whitelist_privatelink_2_0.txt
Syntax ¶ SYSTEM$WHITELIST_PRIVATELINK() Copy
snowflake_docs/show-compute-pools_6_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/alter-api-integration_5_0.txt
Examples ¶ The following example initiates operation of a suspended integration: ALTER API INTEGRATION myint SET ENABLED = TRUE; Copy Was this page helpful? Yes No Inc. All Rights Reserved . On this page 1. Syntax 2. Parameters 3. Usage Notes 4. Examples Language : **English**
snowflake_docs/network_rules_1_0.txt
NETWORK_RULES view ¶ This Account Usage view returns one row for each network rule in your account.
snowflake_docs/encrypt_4_0.txt
Returns ¶ The data type of the returned value is BINARY. Although only a single value is returned, that value contains two or three concatenated fields: * The first field is an initialization vector (IV). The IV is generated randomly using a CTR-DRBG random number generator. Both encryption and decryption use the ...
snowflake_docs/access_history_4_0.txt
Usage notes ¶ Latency and historical data : * The view displays data starting from February 22, 2021. * Latency for the view may be up to 180 minutes (3 hours). Ancestor queries : The ` parent_query_id ` and ` root_query_id ` columns begin to record data starting on January 15-16, 2024, depending on when y...
snowflake_docs/cume_dist_1_0.txt
CUME_DIST ¶ Finds the cumulative distribution of a value with regard to other values within the same window partition.
snowflake_docs/system_get_job_logs_0_0.txt
/ 1. Control 29. Information 90. Query Information SYSTEM$GET_JOB_LOGS Categories:
snowflake_docs/execute-alert_5_0.txt
label-access-control-overview-privileges) at a minimum: Privilege | Object | Notes ---|---|--- EXECUTE ALERT | Account | OWNERSHIP or OPERATE | Alert | USAGE | Warehouse | Required on the warehouse used for the alert. Note that operating on any object in a schema also requires the USAGE privilege on the paren...
snowflake_docs/create-iceberg-table_5_0.txt
Variant syntax ¶ The following variant syntax is supported for creating Iceberg tables that use Snowflake as the catalog.
snowflake_docs/show-procedures_4_0.txt
Usage Notes ¶ * Columns that start with the prefix ` is_ ` return either ` Y ` (yes) or ` N ` (no). * The command does not require a running warehouse to execute. * The command returns a maximum of 10K records for the specified object type, as dictated by the access privileges for the role used to execu...
snowflake_docs/create-resource-monitor_5_0.txt
Usage Notes ¶ * Triggers are optional; however, at least one trigger must be added to a resource monitor before it can perform any actions. * Each resource monitor supports up to a maximum of 5 ` NOTIFY ` action triggers. * After a resource monitor is created, it must be assigned to a warehouse or account...
snowflake_docs/show-materialized-views_6_0.txt
label-working-with-a-materialized-view) . owner | The owner of the materialized view. invalid | True if the materialized view is currently invalid (for example, if the base table dropped a column that the view used); false otherwise. invalid_reason | The reason (if any) that the materialized view is currently inv...
snowflake_docs/to_object_2_0.txt
label-data-type-object) : * For an OBJECT, returns the OBJECT itself. * For all other input values, reports an error.
snowflake_docs/bitxor_agg_4_0.txt
Returns ¶ The data type of the returned value is NUMERIC(38, 0).
snowflake_docs/st_geomfromgeohash_0_0.txt
/ 1. Conversion, Input, Parsing 14. Conversion, Output, Formatting 23. Constructor 32. Accessor 44. Relationship and Measurement 61. Transformation 75. Utility 77. H3 geospatial) ST_GEOMFROMGEOHASH Categories:
snowflake_docs/st_asewkb_6_0.txt
Examples ¶
snowflake_docs/show-aggregation-policies_8_0.txt
label-access-control-securable-objects) , see [ Overview of For additional details on aggregation policy DDL and privileges, see [ aggregation-policy-manage) .
snowflake_docs/desc-iceberg-table_9_0.txt
Example ¶ Create an example Iceberg table: > > CREATE OR REPLACE ICEBERG TABLE my_iceberg_table > CATALOG='my_catalog_integration' > EXTERNAL_VOLUME='my_ext_volume' > METADATA_FILE_PATH='path/to/metadata/v2.metadata.json'; > > > Copy Describe the columns in the table: > > DESC ICEBERG TAB...
snowflake_docs/lead_0_0.txt
/ 1. General 27. Rank-Related 39. Bitwise Aggregation 43. Boolean Aggregation 47. Hash Aggregation 49. Semi-structured Aggregation 52. Counting Distinct Values 55. Linear Regression 65. Statistics and Probability ...
snowflake_docs/drop-session-policy_5_0.txt
Access control requirements ¶ access-control-overview-roles) used to execute this SQL command must have the overview.html
snowflake_docs/top_insights_3_0.txt
Arguments ¶ ` _ categorical_dimensions _ ` containing a 1:1 mapping between dimension names and associated categorical columns. The value can be from a single column or derived from a simple combination of columns. ` _ continuous_dimensions _ ` containing a 1:1 mapping between dimension names and associated contin...
snowflake_docs/anomaly_detection_2_0.txt
CREATE SNOWFLAKE.ML.ANOMALY_DETECTION ¶ Creates an object that you use to detect anomalies or replaces the anomaly detection object of the same name.
snowflake_docs/hll_accumulate_1_0.txt
HLL_ACCUMULATE ¶ Returns the HyperLogLog state at the end of aggregation. For more information about HyperLogLog, see [ Estimating the Number of estimate is returned. In advanced use cases, such as incremental cardinality estimation during bulk loading, one may want to keep the intermediate state. The intermediate s...
snowflake_docs/st_pointn_0_0.txt
/ 1. Conversion, Input, Parsing 14. Conversion, Output, Formatting 23. Constructor 32. Accessor 44. Relationship and Measurement 61. Transformation 75. Utility 77. H3 geospatial) ST_POINTN Categories:
snowflake_docs/undrop-external-volume_1_0.txt
UNDROP EXTERNAL VOLUME ¶ guide/tables-iceberg.html
snowflake_docs/create-warehouse_11_0.txt
label-access-control-securable-objects) , see [ Overview of
snowflake_docs/system_get_login_failure_details_2_0.txt
Syntax ¶ SYSTEM$GET_LOGIN_FAILURE_DETAILS('<uuid>') Copy
snowflake_docs/position_5_0.txt
Collation Details ¶ This function does not support the following collation specifications: * ` pi ` (punctuation-insensitive). * ` cs-ai ` (case-sensitive, accent-insensitive). Note To use this function with a column that has the ` upper ` or ` lower ` collation specifiers, you must [ enable the 2024_02 be...
snowflake_docs/skew_2_0.txt
Syntax ¶ SKEW( <expr> ) Copy
snowflake_docs/listing-consumption-daily_4_0.txt
Examples ¶ Shows top listings by consumption for a given time period: SELECT listing_name, listing_display_name, SUM(jobs) AS jobs FROM snowflake.data_sharing_usage.listing_consumption_daily WHERE 1=1 AND event_date BETWEEN '2021-01-01' AND '2021-01-31' GROUP BY 1,2 O...
snowflake_docs/try_parse_json_6_0.txt
Examples ¶ This shows an example of storing different types of data in a VARIANT column by calling ` TRY_PARSE_JSON ` to parse strings that contain values that can be parsed as JSON: > Create and fill a table. > >> >> create or replace temporary table vartab (ID INTEGER, v VARCHAR); >> >> insert into vart...
snowflake_docs/try_to_date_1_0.txt
TRY_TO_DATE ¶ operation (i.e. converts an input expression to a date), but with error- handling support (i.e. if the conversion cannot be performed, it returns a NULL value instead of raising an error). For more information, see [ Error-handling Conversion Functions See also:
snowflake_docs/hll_export_1_0.txt
HLL_EXPORT ¶ Converts input in BINARY format to OBJECT format. The HyperLogLog states operated on by HLL_ACCUMULATE, HLL_COMBINE, and HLL_ESTIMATE are in a proprietary binary format that may change in future versions of Snowflake. For long-term storage of HyperLogLog states, and for integration with external tools, ...
snowflake_docs/hybrid_table_usage_history_4_0.txt
Examples ¶ This query returns the total number of credits used by hybrid tables in your account over a specific period of time: > > -- Credits used (all time = past year) > SELECT object_name, > SUM(credits_used) AS total_credits > FROM snowflake.account_usage.hybrid_table_usage_history > GROUP...
snowflake_docs/create-row-access-policy_6_0.txt
label-access-control-overview-privileges) at a minimum: Privilege | Object | Notes ---|---|--- CREATE ROW ACCESS POLICY | Schema | Note that operating on any object in a schema also requires the USAGE privilege on the parent database and schema. For instructions on creating a custom role with a specified set of p...
snowflake_docs/regr_syy_3_0.txt
Arguments ¶ ` _ y _ ` The dependent variable. This must be an expression that can be evaluated to a numeric type. ` _ x _ ` The independent variable. This must be an expression that can be evaluated to a numeric type. ` _ expr3 _ ` This is the optional expression used to group rows into partitions. Important Note...
snowflake_docs/transactions_28_0.txt
Transaction ID ¶ Every Snowflake transaction is assigned a unique transaction id. The transaction ID is a signed 64-bit (long) integer. The range of values is -9,223,372,036,854,775,808 (-2 63 ) to 9,223,372,036,854,775,807 (2 63 \- 1). >
snowflake_docs/row_access_policies_3_0.txt
Usage notes ¶ * Latency for the view may be up to 120 minutes (2 hours). * The view only returns rows if row access policies have been created in your account. * The LAST_ALTERED column is updated when the following operations are performed on an object: * DDL operations. * DML operations (for tabl...
snowflake_docs/system_pipe_status_5_0.txt
Output ¶ The function returns a JSON object containing the following name/value pairs (if applicable to the current pipe status): > > {“executionState”:”<value>”,”oldestPendingFilePath”:”<value>”,”oldestFileTimestamp”:<value>,”pendingFileCount”:<value>,”lastPipeErrorTimestamp”:”<value>”,”lastPipeFaultTimestamp”:”<va...
snowflake_docs/alter-table_22_0.txt
Examples ¶ The following sections provide examples of using the ALTER COLUMN command: * Renaming a Table * Swapping Tables * Adding Columns * Renaming Columns * Dropping Columns * Adding, Renaming, and Dropping Columns in an External Table * Changing the Order of Clustering Keys * Adding and D...
snowflake_docs/show-hybrid-tables_7_0.txt
Examples ¶ Show all the hybrid tables whose name starts with ` product_ ` that you have privileges to view in the ` mydb.myschema ` schema: SHOW HYBRID TABLES LIKE 'product_%' IN mydb.myschema; Copy
snowflake_docs/commit_0_0.txt
/
snowflake_docs/h3_coverage_3_0.txt
Syntax ¶ H3_COVERAGE( <geography_expression> , <target_resolution> ) Copy
snowflake_docs/begin_2_0.txt
Syntax ¶ BEGIN <statement>; [ <statement>; ... ] [ EXCEPTION <exception_handler> ] END; Copy Where: > ` _ statement _ ` > > > A statement can be any of the following: > > * A single SQL statement (including CALL). > > guide/snowflake-scripting/branch) statement). > > > > > ` _ except...
snowflake_docs/trunc2_4_0.txt
Returns ¶ The function always returns a DATE. The date is complete (year, month, and day). Truncation does not remove the month and day; instead it sets them to the earliest date in the specified period. For example, ` TRUNC(TO_DATE('2013-08-05'), 'QUARTER') ` returns the first date in the third quarter of the yea...
snowflake_docs/create-function_20_0.txt
Optional Parameters ¶
snowflake_docs/strip_null_value_3_0.txt
Syntax ¶ STRIP_NULL_VALUE( <variant_expr> ) Copy
snowflake_docs/alter-stage_10_0.txt
TYPE = AVRO ¶ ` COMPRESSION = AUTO | GZIP | BROTLI | ZSTD | DEFLATE | RAW_DEFLATE | NONE ` Use : Data loading only Definition : * When loading data, specifies the current compression algorithm for the data file. Snowflake uses this option to detect how an already-compressed data file was compress...
snowflake_docs/timestampdiff_0_0.txt
/ 1. Construction 5. Extraction 29. Addition & Subtraction 38. Truncation 42. Conversion 57. Time Zone 59. Alerts date-time) TIMESTAMPDIFF Categories:
snowflake_docs/show-tags_9_0.txt
Examples ¶ Show tags in a given schema: > > SHOW TAGS IN SCHEMA my_db.my_schema; > > > Copy > > > > ------------------------------+----------------+---------------+-------------+--------------+--------------------+----------------+-----------------+ > created_on | name | da...
snowflake_docs/associate_semantic_category_tags_3_0.txt
Arguments ¶ ` _ object_name _ ` The name of the table, external table, view, or materialized view containing the columns to be classified. If a database and schema are not in use in the current session, the name must be fully-qualified. The name must be specified exactly as it is stored in the database. If the name...
snowflake_docs/st_x_4_0.txt
Returns ¶ Returns a REAL value.
snowflake_docs/alter-warehouse_10_0.txt
label-security-custom-role) . For general information about roles and privilege grants for performing SQL overview.html
snowflake_docs/drop-function_4_0.txt
Usage Notes ¶ **All Languages** Dropped functions cannot be recovered; they must be recreated. **Java, Python, and Scala** For UDFs that store code in a file (such as a .jar file or .py file) in a stage, the ` DROP FUNCTION ` command does not remove the file. Different UDFs can use different functions/methods in t...
snowflake_docs/regexp_instr_9_2.txt
from demo3; > > +----+----------------------+------------+-----------+------------+-----------+------------+-----------+------------+-----------+ > | ID | STRING1 | SUBSTRING1 | POSITION1 | SUBSTRING2 | > POSITION2 | SUBSTRING3 | POSITION3 | SUBSTRING4 | POSITION4 | > > |----+-----------------...
snowflake_docs/system_cancel_query_1_0.txt
SYSTEM$CANCEL_QUERY ¶ Cancels the specified query (or statement) if it is currently active/running. See also:
snowflake_docs/alter-alert_7_0.txt
| | | ____ month (1-12, JAN-DEC)
snowflake_docs/h3_grid_disk_0_0.txt
/ 1. Conversion, Input, Parsing 14. Conversion, Output, Formatting 23. Constructor 32. Accessor 44. Relationship and Measurement 61. Transformation 75. Utility 77. H3 geospatial) H3_GRID_DISK Categories:
snowflake_docs/coalesce_4_0.txt
label-data-type-explicit-casting) the argument to a type that can represent the value.
snowflake_docs/soundex_4_0.txt
Returns ¶ The returned value is a VARCHAR that contains the phonetic representation of the input string. In other words, the return value is a string (not a sound) that represents the pronunciation (not the spelling) of the input string. Note the following: * The returned value starts with a letter that represents...
snowflake_docs/system_query_reference_3_0.txt
Arguments ¶ **Required** ` _ select_statement _ ` The SELECT statement to pass to the stored procedure. This must be a statement that serves as an inline view. Note that if the SELECT statement contains any single quotes or other special characters (e.g. newlines), you must [ escape those characters with escape-seq...
snowflake_docs/system_estimate_query_acceleration_6_0.txt
Examples ¶ For example queries, see [ Identifying Queries with the acceleration-service.html
snowflake_docs/create-stage_7_0.txt
External stage parameters ( ` externalStageParams ` ) ¶ ` URL = ' _ cloud_specific_url _ ' ` If this parameter is omitted, Snowflake creates an internal stage Important * Enclose the URL in single quotes ( ` '' ` ) in order for Snowflake to identify the string. If the quotes are omitted, any credentials you...
snowflake_docs/sentiment-snowflake-cortex_1_0.txt
SENTIMENT (SNOWFLAKE.CORTEX) ¶ cortex/llm-functions.html
snowflake_docs/commands-warehouse_0_0.txt
/ 1. Virtual Warehouses 8. Resource Monitors commands) Virtual Warehouses & Resource Monitors
snowflake_docs/binary-input-output_12_0.txt
Hexadecimal (“HEX”) Format Example ¶ One way to enter BINARY data is to encode it as a string of hexadecimal characters. An example is below. > Start by creating a table with a BINARY column: > > > CREATE TABLE demo_binary (b BINARY); > > > Copy > > If you try to insert an “ordinary” string by using the TO...
snowflake_docs/show-databases-in-replication-group_3_0.txt
Parameters ¶ ` _ name _ ` Specifies the identifier for the replication group.
snowflake_docs/regexp_instr_3_0.txt
Arguments ¶ **Required:** ` _ subject _ ` The string to search for matches. ` _ pattern _ ` Pattern to match. **Optional:** ` _ position _ ` Number of characters from the beginning of the string where the function starts searching for matches. Default: ` 1 ` (the search for a match starts at the first character ...
snowflake_docs/call-with_18_0.txt
Syntax ¶ It is, however, possible to specify a simple variable whose value is assigned in the WITH clause. * The CALL clause must occur last in the syntax.