Is there a good pattern for configuring destinatio...
# singer-targets
m
Is there a good pattern for configuring destination column types with the
target-redshift
repos that meltano endorses? Or at least graceful upgrading of columns over time? Context: previously we were using https://github.com/transferwise/pipelinewise-target-redshift - which makes an interesting assumption that all numeric columns should get persisted as
double precision
. This isn't exactly ideal for financial information - which is the use case we're solving for. I took a look at the version that's maintained https://github.com/TicketSwap/target-redshift - and it looks like it also makes the same assumption. https://github.com/TicketSwap/target-redshift/blob/main/target_redshift/connector.py#L237
e
Hi @Michael Sandt 👋
Is there a good pattern for configuring destination column types with the
target-redshift
repos that meltano endorses? Or at least graceful upgrading of columns over time?
Yes, there is. That's what the schema _extra_ is for. The target is unfortunately not on the singer-sdk 0.45.x version, but if you are able to fork their repo to bump it, then you could use the
x-singer.decimal
string format:
Copy code
extractors:
- name: <tap-yourtap>
  schema:
    <some_stream_id>:
      <some_numeric_field>:
        type: ["string", "null"]
        format: x-singer.decimal
        scale: ...
        precision: ...
I actually take that back. You'd not only need to bump their dependency on singer-sdk, but also update the
to_sql_type
implementation to look like Snowflake's: https://github.com/MeltanoLabs/target-snowflake/blob/1a7d43a67c78189b7bba8a5335801313d9e6a9ae/target_snowflake/connector.py#L320-L329