SSC-FDM-PG0010

Results may vary due to the behavior of Snowflake's bitwise function.

circle-info

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentationarrow-up-right

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected]envelope.

Thank you for your understanding.

Description

The bitwise operators <<arrow-up-right and >>arrow-up-right are converted to the corresponding Snowflake functions BITSHIFTLEFTarrow-up-right and BITSHIFTRIGHTarrow-up-right. However, due to differences in how these functions handle expressions, the results may differ from those in PostgreSQL.

Code Example

Input Code:

IN -> PostgreSQL_01.sql
SELECT 1 << 127 AS resultShiftedLeft, 16 >> 32 AS resultShiftedRight;

Output Code:

OUT -> PostgreSQL_01.sql
SELECT
--** SSC-FDM-PG0010 - RESULTS MAY VARY DUE TO THE BEHAVIOR OF SNOWFLAKE'S BITSHIFTLEFT BITWISE FUNCTION **
BITSHIFTLEFT( 1, 127) AS resultShiftedLeft,
--** SSC-FDM-PG0010 - RESULTS MAY VARY DUE TO THE BEHAVIOR OF SNOWFLAKE'S BITSHIFTRIGHT BITWISE FUNCTION **
BITSHIFTRIGHT( 16, 32) AS resultShiftedRight;

Recommendations

Last updated