SSC-FDM-PG0010
Results may vary due to the behavior of Snowflake's bitwise function.
Description
The bitwise operators << and >> are converted to the corresponding Snowflake functions BITSHIFTLEFT and BITSHIFTRIGHT. However, due to differences in how these functions handle expressions, the results may differ from those in PostgreSQL.
Code Example
Input Code:
SELECT 1 << 127 AS resultShiftedLeft, 16 >> 32 AS resultShiftedRight;Output Code:
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
If you need more support, you can email us at [email protected]
Last updated
