SSC-EWI-RS0006
The behavior of the SUBSTRING function may differ when applied to binary data.
Severity
Medium
Description
The behavior of the SUBSTRING
function may differ when applied to binary data. Since Redshift and Snowflake handle binary data differently, the results may vary between the two platforms.
Code Example
Input Code:
SELECT SUBSTRING('12345'::varbyte, 2, 4) AS substring_binary;
SELECT SUBSTRING('abc'::varbyte, 2, 4) AS substring_binary;
Output Code:
SELECT SUBSTRING('12345':: BINARY, 2, 4) !!!RESOLVE EWI!!! /*** SSC-EWI-RS0006 - THE BEHAVIOR OF THE SUBSTRING FUNCTION MAY DIFFER WHEN APPLIED TO BINARY DATA. ***/!!! AS substring_binary;
SELECT SUBSTRING('abc':: BINARY, 2, 4) !!!RESOLVE EWI!!! /*** SSC-EWI-RS0006 - THE BEHAVIOR OF THE SUBSTRING FUNCTION MAY DIFFER WHEN APPLIED TO BINARY DATA. ***/!!! AS substring_binary;
Recommendations
If you need more support, you can email us at [email protected]
Last updated