SnowConvert AI - BigQuery - Built-in functions

Translation reference for all the supported built-in functions by SnowConvert AI for BigQuery.

Note

For more information about built-in functions and their Snowflake equivalents, also see Common built-in functions.

Aggregate Functions

Array Functions

BigQuerySnowflake
ARRAY_AGG (https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions#array_agg)ARRAY_AGG
ARRAY_CONCAT (https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_concat)ARRAY_CAT
ARRAY_CONCAT_AGG (https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions#array_concat_agg)ARRAY_FLATTEN
ARRAY_TO_STRING (https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_to_string)(expr, delimiter)ARRAY_TO_STRING(ARRAY_COMPACT(expr), delimiter)
ARRAY_TO_STRING (https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_to_string)(expr, delimiter, null_text)

ARRAY_TO_STRING_UDF(expr, delimiter, null_text)

Notes: SnowConvert AI generates a UDF to handle the NULL replacement parameter which is not natively supported in Snowflake’s ARRAY_TO_STRING function.

SELECT ARRAY (https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#array_subquery) (SELECT query)

SELECT (SELECT ARRAY_AGG(*) FROM (SELECT query))

Notes: BigQuery’s ARRAY subquery syntax is transformed to use ARRAY_AGG with a subquery in Snowflake.

Conditional Expressions

BigQuerySnowflake

COALESCE

COALESCE

IF

IFF

IFNULL

IFNULL

NULLIF

NULLIF

Conversion Functions

BigQuerySnowflake
SAFE_CAST (https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions#safe_casting)TRY_CAST
SAFE. (https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#safe_prefix) prefix on cast-style functions (e.g. SAFE.PARSE_DATE, SAFE.PARSE_TIMESTAMP, SAFE.CAST)

Equivalent TRY_* function (TRY_TO_DATE, TRY_TO_TIMESTAMP_TZ, TRY_CAST, etc.)

Notes: SnowConvert AI rewrites the SAFE-prefixed call to the corresponding TRY_* Snowflake function so failures return NULL instead of raising an error.

Date Functions

BigQuerySnowflake

CURRENT_DATE
CURRENT_DATE()

CURRENT_DATE

CURRENT_DATE()

DATE_ADD (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_add)(date, INTERVAL n part)

DATEADD(‘part’, n, date)

Notes: SnowConvert AI re-orders the arguments and converts the BigQuery INTERVAL n part literal into Snowflake’s (part_string, n, date) argument layout. Negative literals are preserved.

DATE_SUB (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_sub)(date, INTERVAL n part)

DATEADD(‘part’, -n, date)

Notes: Snowflake has no DATE_SUB; the call is rewritten to DATEADD with the integer expression negated. Literal negative intervals collapse, non-literals are wrapped with a unary minus.

DATE_DIFF (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_diff)(date_a, date_b, part)

DATEDIFF(‘part’, date_b, date_a)

Notes: BigQuery’s DATE_DIFF(a, b, part) computes a - b; Snowflake’s DATEDIFF('part', b, a) reverses the operand order. SnowConvert AI swaps the arguments so the result sign matches BigQuery. ISOWEEK, ISOYEAR and WEEK(<weekday>) are translated to the corresponding Snowflake date parts.

DATE_TRUNC (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_trunc)(date, part)

DATE_TRUNC(‘part’, date)

Notes: BigQuery uses (date, part) argument order; Snowflake uses ('part', date). SnowConvert AI swaps the arguments and quotes the part as a string literal.

EXTRACT (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#extract)(DAYOFWEEK FROM date)

DAYOFWEEK(date) + 1

Notes: BigQuery’s DAYOFWEEK returns 1..7 with Sunday = 1; Snowflake’s returns 0..6 with Sunday = 0. SnowConvert AI adds + 1 to keep the result aligned. See SSC-FDM-BQ0008 when the argument is influenced by the WEEK_START session parameter.

EXTRACT (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#extract)(ISOWEEK FROM date)

EXTRACT(WEEKISO FROM date)

Notes: BigQuery’s ISOWEEK date part is renamed to Snowflake’s WEEKISO.

FORMAT_DATE (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#format_date)

TO_CHAR

Note: For further details on this translation, please consult this page.

PARSE_DATE (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#parse_date)(format_string, date_string)

TO_DATE(date_string, translated_format)

Notes: BigQuery format codes (%Y, %m, %d, etc.) are translated at compile time to Snowflake equivalents (YYYY, MM, DD, etc.). Non-literal format strings are passed through unchanged with a warning.

Datetime Functions

BigQuerySnowflake

CURRENT_DATETIME

CURRENT_DATETIME()

CURRENT_TIMESTAMP :: TIMESTAMP_NTZ
CURRENT_TIMESTAMP() :: TIMESTAMP_NTZ

DATETIME (https://cloud.google.com/bigquery/docs/reference/standard-sql/datetime_functions#datetime)(year, month, day, hour, minute, second)

TIMESTAMP_NTZ_FROM_PARTS(year, month, day, hour, minute, second)

Notes: BigQuery’s DATETIME constructor maps to Snowflake’s TIMESTAMP_NTZ_FROM_PARTS. The single-argument form DATETIME(timestamp) and the DATETIME(date, time) form are also supported.

PARSE_DATETIME (https://cloud.google.com/bigquery/docs/reference/standard-sql/datetime_functions#parse_datetime)(format_string, datetime_string)

TO_TIMESTAMP_NTZ(datetime_string, translated_format)

Notes: BigQuery format codes are translated at compile time to Snowflake equivalents. Non-literal format strings are passed through unchanged with a warning.

Time Functions

BigQuerySnowflake
PARSE_TIME (https://cloud.google.com/bigquery/docs/reference/standard-sql/time_functions#parse_time)(format_string, time_string)

TO_TIME(time_string, translated_format)

Notes: BigQuery format codes are translated at compile time to Snowflake equivalents. Non-literal format strings are passed through unchanged with a warning.

FORMAT_TIME (https://cloud.google.com/bigquery/docs/reference/standard-sql/time_functions#format_time)(format_string, time_expr)

TO_CHAR(time_expr, translated_format)

Notes: BigQuery format codes are translated at compile time to Snowflake equivalents. Non-literal format strings are passed through unchanged with a warning.

TIME_ADD (https://cloud.google.com/bigquery/docs/reference/standard-sql/time_functions#time_add)(time_expr, INTERVAL n part)

DATEADD(‘part’, n, time_expr)

Notes: SnowConvert AI re-orders the arguments and converts the BigQuery INTERVAL n part literal into Snowflake’s (part_string, n, time_expr) argument layout.

TIME_DIFF (https://cloud.google.com/bigquery/docs/reference/standard-sql/time_functions#time_diff)(time1, time2, part)

DATEDIFF(‘part’, time2, time1)

Notes: BigQuery’s TIME_DIFF(a, b, part) computes a - b; SnowConvert AI swaps the arguments to match Snowflake’s (start, end) convention.

TIME_SUB (https://cloud.google.com/bigquery/docs/reference/standard-sql/time_functions#time_sub)(time_expr, INTERVAL n part)

DATEADD(‘part’, -n, time_expr)

Notes: Snowflake has no TIME_SUB; SnowConvert AI rewrites the call to DATEADD with the interval count negated.

Time Functions

BigQuerySnowflake

FORMAT_TIME(format, time_expr)

TO_CHAR(time_expr, converted_format)

Notes: BigQuery strptime-style format specifiers (e.g. %H, %M, %S, %T, %R) are mapped to Snowflake TO_CHAR format codes. Unsupported specifiers emit SSC-EWI-0006. Non-literal format arguments fall through to SSC-EWI-0073.

TIME_ADD(time_expr, INTERVAL n part)

DATEADD(‘part’, n, time_expr)

Notes: SnowConvert AI re-orders the arguments and converts the BigQuery INTERVAL n part literal into Snowflake’s argument layout.

TIME_DIFF(time1, time2, part)

DATEDIFF(‘part’, time2, time1)

Notes: SnowConvert AI swaps the arguments so the result sign matches BigQuery’s time1 - time2 semantics.

TIME_SUB(time_expr, INTERVAL n part)

DATEADD(‘part’, -n, time_expr)

Notes: Snowflake has no TIME_SUB; SnowConvert AI rewrites the call to DATEADD with the interval count negated.

Geography Functions

BigQuerySnowflake
ST_GEOGFROMTEXT (https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_geogfromtext)

ST_GEOGFROMTEXT

Note: For further details on this translation, please consult this page.

ST_GEOGPOINT (https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_geogpoint)

ST_POINT

Note: For further details on this translation, please consult this page.

ST_DISTANCE (https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_distance)(geog_a, geog_b [, use_spheroid])

ST_DISTANCE(geog_a, geog_b)

Notes: The two-argument form is a direct pass-through. The three-argument use_spheroid parameter has no Snowflake equivalent and is dropped; if its value is anything other than the literal FALSE, see SSC-FDM-BQ0014.

JSON Functions

BigQuerySnowflake
JSON_VALUE (https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_value) / JSON_EXTRACT_SCALAR (https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_extract_scalar)

JSON_EXTRACT_PATH_TEXT

Notes: SnowConvert AI automatically translates BigQuery JSON paths to their Snowflake equivalents.

JSON_VALUE_ARRAY (https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_value_array)

JSON_VALUE_ARRAY_UDF

Notes: SnowConvert AI generates a UDF to obtain an equivalent behavior for extracting arrays from JSON.

LAX_INT64 (https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#lax_int64)

PUBLIC.LAX_INT64_UDF

Notes: SnowConvert AI generates a UDF to obtain an equivalent behavior.

LAX_BOOL (https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#lax_bool)

PUBLIC.LAX_BOOL_UDF

Notes: SnowConvert AI generates a UDF to obtain an equivalent behavior.

PARSE_JSON (https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#parse_json)(json_string [, wide_number_mode => ‘exact’ | ‘round’])

PARSE_JSON(json_string)

Notes: The single-argument form is a direct pass-through. The optional wide_number_mode argument has no Snowflake equivalent and is dropped; Snowflake preserves number precision up to 38 digits. See SSC-FDM-BQ0015.

Mathematical Functions

Numbering Functions

Security Functions

BigQuerySnowflake
SESSION_USER (https://cloud.google.com/bigquery/docs/reference/standard-sql/security_functions#session_user)

CURRENT_USER

Notes: BigQuery’s SESSION_USER returns the email address of the authenticated IAM principal; Snowflake’s CURRENT_USER returns the Snowflake username (not an email). See SSC-FDM-BQ0016.

String Functions

BigQuerySnowflake
BYTE_LENGTH (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#byte_length)(expr)

LENGTH(TO_BINARY(HEX_ENCODE(expr)))

Notes: BigQuery’s BYTE_LENGTH returns the number of bytes in an encoded string. Snowflake equivalent converts to binary after hex encoding to get byte length.

CHARACTER_LENGTH
CHAR_LENGTH

LENGTH
CONCAT (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#concat)CONCAT
ENDS_WITH (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#ends_with)ENDSWITH
FROM_BASE64 (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#from_base64)

TRY_BASE64_DECODE_BINARY

Notes: BigQuery defaults to BASE64 for binary data output, but Snowflake uses HEX. In Snowflake, you can use the BASE64_ENCODE function or set BINARY_OUTPUT_FORMAT to 'BASE64' to view binary data in BASE64.

FROM_HEX (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#from_hex)

TRY_HEX_DECODE_BINARY

Notes: BigQuery defaults to BASE64 for binary data output, but Snowflake uses HEX. In Snowflake, you can use the BASE64_ENCODE function or set BINARY_OUTPUT_FORMAT to 'BASE64' to view binary data in BASE64.

LEFT (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#left)LEFT
LENGTH (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#length)LENGTH
LOWER (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#lower)LOWER
LPAD (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#lpad)LPAD
LTRIM (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#ltrim)LTRIM
REGEXP_CONTAINS (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains)(value, regexp)REGEXP_INSTR(value, regexp) > 0
REGEXP_EXTRACT_ALL (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract_all)REGEXP_SUBSTR_ALL
REPLACE (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#replace)REPLACE
RIGHT (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#right)RIGHT
RPAD (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#rpad)RPAD
RTRIM (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#rtrim)RTRIM
SPLIT (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#split)SPLIT
STARTS_WITH (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#starts_with)STARTSWITH

SUBSTR(string, position)

SUBSTRING(string, position)

SUBSTR(string, position, length)

SUBSTRING(string, position, length)

SUBSTR(string, IFF(position < -LENGTH(string), 1, position))

SUBSTRING(string, IFF(position < -LENGTH(string), 1, position))

SUBSTR(string, IFF(position < -LENGTH(string), 1, position), length)

SUBSTRING(string, IFF(position < -LENGTH(string), 1, position), length)

TO_HEX (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#to_hex)HEX_ENCODE
UNICODE (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#unicode)(string_expr)

UNICODE(string_expr)

Notes: Direct pass-through. Both functions return the Unicode code point of the first character of the input string.

UPPER (https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#upper)UPPER

Timestamp Functions

BigQuerySnowflake

CURRENT_TIMESTAMP
CURRENT_TIMESTAMP()

CURRENT_TIMESTAMP

CURRENT_TIMESTAMP()

SAFE.TIMESTAMP_MILLIS (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#timestamp_millis)

IFF(expr BETWEEN -62135596800000 AND 253402300799999, TO_TIMESTAMP(expr / 1000), null)

Notes: Safe version with range validation to prevent overflow errors.

SAFE.TIMESTAMP_SECONDS (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#timestamp_seconds)

SAFE_TIMESTAMP_SECONDS_UDF(expr)

Notes: SnowConvert AI generates a UDF to provide safe timestamp conversion with error handling.

TIMESTAMP_MILLIS (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#timestamp_millis)

TO_TIMESTAMP(expr / 1000)

Notes: Converts milliseconds since epoch to timestamp by dividing by 1000.

TIMESTAMP_SECONDS (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#timestamp_seconds)(expr)

DATEADD(‘seconds’, expr, ’1970-01-01’)

Notes: Adds seconds to Unix epoch start date.

UNIX_MICROS (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#unix_micros)(timestamp)

DATE_PART(‘epoch_microsecond’, CONVERT_TIMEZONE(‘UTC’, timestamp))

Notes: Extracts microseconds since Unix epoch from timestamp converted to UTC.

UNIX_MILLIS (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#unix_millis)(timestamp)

DATE_PART(‘epoch_millisecond’, CONVERT_TIMEZONE(‘UTC’, timestamp))

Notes: Extracts milliseconds since Unix epoch from timestamp converted to UTC.

UNIX_SECONDS (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#unix_seconds)(timestamp)

DATE_PART(‘epoch_seconds’, CONVERT_TIMEZONE(‘UTC’, timestamp))

Notes: Extracts seconds since Unix epoch from timestamp converted to UTC.

PARSE_TIMESTAMP (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#parse_timestamp)(format_string, timestamp_string [, timezone])

TO_TIMESTAMP_NTZ(timestamp_string, converted_format) — or, when a timezone argument is supplied, CONVERT_TIMEZONE(timezone, ‘UTC’, TO_TIMESTAMP_NTZ(…)) :: TIMESTAMP_TZ

Notes: BigQuery format elements (e.g. %Y-%m-%d %H:%M:%S) are translated to the equivalent Snowflake format. The 3-argument form emits SSC-EWI-BQ0018 because Snowflake interprets the timezone as the source rather than the result of the parse.

FORMAT_TIMESTAMP (https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#format_timestamp)(format_string, timestamp [, timezone])

TO_VARCHAR(timestamp, converted_format) — or, when a timezone argument is supplied, TO_VARCHAR(CONVERT_TIMEZONE(timezone, timestamp), converted_format)

Notes: BigQuery format elements are translated to the equivalent Snowflake format. The 3-argument form first shifts the timestamp into the requested timezone before formatting.

FORMAT_DATE

Format_date function

Description

Formats a DATE value according to a specified format string.

For more information, please refer to FORMAT_DATE (https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#format_date) function.

Grammar Syntax

 FORMAT_DATE(format_string, date_expr)

Sample Source

BigQuery
CREATE TABLE TEST_DATE (col1 DATE);
SELECT FORMAT_DATE('%Y', col1);

Snowflake
CREATE TABLE TEST_DATE (col1 DATE);
SELECT
  TO_CHAR(col1, 'YYYY')
FROM
  TEST_DATE;

BigQuery Formats Equivalents

BigQuerySnowflake
%APUBLIC.DAYNAME_LONG_UDF(date_expr)

Note: Generate UDF in conversion for support.
%aDY
%BMMMM
%bMON
%CPUBLIC.CENTURY_UDF(date_expr)

Note: Generate UDF in conversion for support.
%cDY MON DD HH24:MI:SS YYYY
%DMM/DD/YY
%dDD
%eDD
%FYYYY-MM-DD
%GYEAROFWEEKISO(date_expr)
%gPUBLIC.ISO_YEAR_PART_UDF(date_expr, 2)

Note: Generate UDF in conversion for support.
%HHH24
%hMON
%IHH12
%JPUBLIC.DAY_OF_YEAR_ISO_UDF(date_expr)

Note: Generate UDF in conversion for support.
%jDAYOFYEAR(date_expr)
%kHH24
%lHH12
%MMI
%mMM
%nNot equivalent format
%Ppm
%pAM
%QQUARTER(date_expr)
%RHH24:MI
%SSS
%sNot equivalent format
%THH24:MI:SS
%tNot equivalent format
%UWEEK(date_expr)
%uDAYOFWEEKISO(date_expr)
%VWEEKISO(date_expr)
%WWEEK(date_expr)

Note: Unlike BigQuery, Snowflake results are dictated by the values set for the WEEK_OF_YEAR_POLICY and/or WEEK_START session parameters. So, results could differ from BigQuery based on those parameters.
%wDAYOFWEEK(date_expr)

Note: Unlike BigQuery, Snowflake results are dictated by the values set for the WEEK_OF_YEAR_POLICY and/or WEEK_START session parameters. So, results could differ from BigQuery based on those parameters.
%XHH24:MI:SS
%xMM/DD/YY
%YYYYY
%yYY
%ZNot equivalent format
%zNot equivalent format
%EzNot equivalent format
%E<number>SNot equivalent format
%E*SNot equivalent format
%EY4YYYY

Warning

In BigQuery, the format related to time is not applied when the type is DATE, but Snowflake applies the format with values in zero for HH:MI:SS usages.

Note

For more information, please refer to BigQuery DateTime formats (https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#format_elements_date_time).

ST_GEOGFROMTEXT

Geography Function.

Description

Returns a GEOGRAPHY value that corresponds to the input WKT representation.

For more information, please refer to ST_GEOGFROMTEXT (https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_geogfromtext) function.

Note

:class: tip ST_GEOGFROMTEXT function is supported in Snowflake.

Grammar Syntax

 ST_GEOGFROMTEXT(wkt_string[, oriented])

Sample Source

The oriented parameter in the ST_GEOGFROMTEXT function is not supported in Snowflake.

BigQuery
 SELECT ST_GEOGFROMTEXT('POINT(-122.35 37.55)');
SELECT ST_GEOGFROMTEXT('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))', TRUE);

Snowflake
 SELECT ST_GEOGFROMTEXT('POINT(-122.35 37.55)');
SELECT
!!!RESOLVE EWI!!! /*** SSC-EWI-BQ0006 - ORIENTED PARAMETER IN THE ST_GEOGFROMTEXT FUNCTION IS NOT SUPPORTED IN SNOWFLAKE. ***/!!!
ST_GEOGFROMTEXT('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))');

Please keep in mind that the default output format for geography data types is WKT (Well-Known Text) and in Snowflake WKB (Well-Known Binary). You can use the ST_ASWKT function or set the GEOGRAPHY_OUTPUT_FORMAT format if you want to view the data in WKT format.

Using ST_GEOGFROMTEXT function to insert geography data

This function is not allowed in the values clause and is not required in Snowflake.

BigQuery
 CREATE OR REPLACE TABLE test.geographyType
(
  COL1 GEOGRAPHY
);

INSERT INTO test.geographyType VALUES
    (ST_GEOGFROMTEXT('POINT(-122.35 37.55)')),
    (ST_GEOGFROMTEXT('LINESTRING(-124.20 42.00, -120.01 41.99)'));

Snowflake
 CREATE OR REPLACE TABLE test.geographyType
(
  COL1 GEOGRAPHY
);

INSERT INTO test.geographyType
VALUES
    (
     --** SSC-FDM-BQ0010 - THE FUNCTION 'ST_GEOGFROMTEXT' IS NOT REQUIRED IN SNOWFLAKE. **
     'POINT(-122.35 37.55)'),
    (
     --** SSC-FDM-BQ0010 - THE FUNCTION 'ST_GEOGFROMTEXT' IS NOT REQUIRED IN SNOWFLAKE. **
     'LINESTRING(-124.20 42.00, -120.01 41.99)');

  1. SSC-EWI-BQ0006: Oriented parameter in the ST_GEOGFROMTEXT function is not supported in Snowflake.
  2. SSC-FDM-BQ0010: Geography function is not required in Snowflake.

ST_GEOGPOINT

Geography Function.

Description

Creates a GEOGRAPHY with a single point. ST_GEOGPOINT creates a point from the specified FLOAT64 longitude (in degrees, negative west of the Prime Meridian, positive east) and latitude (in degrees, positive north of the Equator, negative south) parameters and returns that point in a GEOGRAPHY value.

For more information, please refer to ST_GEOGPOINT (https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_geogpoint)function.&#x20;

Note

The function ST_GEOGPOINT is translated to ST_POINT in Snowflake.

Grammar Syntax

 ST_GEOGPOINT(longitude, latitude)

Sample Source

BigQuery
 SELECT ST_GEOGPOINT(-122.0838, 37.3860);

Snowflake
 SELECT ST_POINT(-122.0838, 37.3860);

Please keep in mind that the default output format for geography data types is WKT (Well-Known Text) and in Snowflake WKB (Well-Known Binary). You can use the ST_ASWKT function or set the GEOGRAPHY_OUTPUT_FORMAT format if you want to view the data in WKT format.

Using ST_POINT function to insert geography data

This function is not allowed in the values clause and is not required in Snowflake.

BigQuery
 CREATE OR REPLACE TABLE test.geographyType
(
  COL1 GEOGRAPHY
);

INSERT INTO test.geographyType
VALUES (ST_GEOGPOINT(-122.0838, 37.3860));

Snowflake
 CREATE OR REPLACE TABLE test.geographyType
(
  COL1 GEOGRAPHY
)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "bigquery",  "convertedOn": "04/03/2025",  "domain": "test" }}';

INSERT INTO test.geographyType
VALUES (
--** SSC-FDM-BQ0010 - THE FUNCTION 'ST_GEOGFROMTEXT' IS NOT REQUIRED IN SNOWFLAKE. **
'POINT(122.0838 37.3860)');

  1. SSC-FDM-BQ0010: Geography function is not required in Snowflake.

Debugging Functions

BigQuerySnowflake
ERROR (https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging_functions#error)(message)

PUBLIC.ERROR_UDF(message)

Notes: BigQuery’s ERROR raises a runtime error with the supplied message. SnowConvert generates a UDF wrapper that calls a Snowflake stored procedure to raise an equivalent exception, since Snowflake SQL does not provide a built-in ERROR function in scalar context.

UUID Functions

BigQuerySnowflake
GENERATE_UUID (https://cloud.google.com/bigquery/docs/reference/standard-sql/uuid_functions#generate_uuid)()

UUID_STRING()

Notes: Both functions return an RFC 4122-compliant version 4 UUID as a string. Direct replacement.