This adds support for Redshift. The main complications were around JSON parsing, casting and array element accessing in tests.
I set the bind mode to false in the integration tests so that we don't drop views by accident. See more about binding here. To my knowledge this only affects Redshift.
I added two new macros:
cast - abstracts the casting logic to simplify some other macros, makes it easy to cast booleans in Redshift since Redshift cannot natively cast a string like "true" to a boolean like the other warehouses.
get_array_element - we are required to use a function to access elements in a Redshift array, because of this we needed to create a macro that can switch between the two indexing methods based on the target type.
I also modified the json_value macro to be use Redshift JSON functions with the target is redshift.
I have testing this locally against a running Redshift cluster, but will need to setup the integration tests for Redshift once our testing infrastructure is available.
This adds support for Redshift. The main complications were around JSON parsing, casting and array element accessing in tests.
I set the
bind
mode tofalse
in the integration tests so that we don't drop views by accident. See more about binding here. To my knowledge this only affects Redshift.I added two new macros:
cast
- abstracts the casting logic to simplify some other macros, makes it easy to cast booleans in Redshift since Redshift cannot natively cast a string like"true"
to a boolean like the other warehouses.get_array_element
- we are required to use a function to access elements in a Redshift array, because of this we needed to create a macro that can switch between the two indexing methods based on the target type.I also modified the
json_value
macro to be use Redshift JSON functions with the target isredshift
.I have testing this locally against a running Redshift cluster, but will need to setup the integration tests for Redshift once our testing infrastructure is available.