sdk icon indicating copy to clipboard operation
sdk copied to clipboard

feat: configurable target schema change settings by default

Open pnadolny13 opened this issue 2 years ago • 7 comments

The target sdk sql connector class has allow_column_alter which is set by the target developer in the connector implementation. We should make this a configuration option thats available to the user by default. It will let us have a consistent enum of options available to the user with a consistent config name instead of letting each developer implement it themselves in slightly different ways.

Related

  • https://github.com/meltano/sdk/issues/1783
  • https://github.com/meltano/sdk/pull/2504
  • https://github.com/meltano/sdk/pull/2505

pnadolny13 avatar Jun 21 '23 17:06 pnadolny13

This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.

stale[bot] avatar Jun 20 '24 17:06 stale[bot]

Still relevant. @edgarrmondragon this might be something we want to have available as an option in Arch so having a way to control it externally would be nice eventually.

pnadolny13 avatar Jun 21 '24 13:06 pnadolny13

Still relevant. @edgarrmondragon this might be something we want to have available as an option in Arch so having a way to control it externally would be nice eventually.

Makes sense. Should be pretty quick to implement too fwiw.

edgarrmondragon avatar Jun 21 '24 17:06 edgarrmondragon

Related:

  • https://github.com/meltano/sdk/pull/2505

edgarrmondragon avatar Nov 27 '24 00:11 edgarrmondragon

Would love to be able to modify my schemas outside of meltano and just have meltano "bootstrap" schemas, and then adjust accordingly as I manage things on my end.

Load it all in as text initially for example, but if I come and change it to int later, just roll with it and follow the new rule(s).

atrauzzi avatar Dec 16 '24 19:12 atrauzzi

Would love to be able to modify my schemas outside of meltano and just have meltano "bootstrap" schemas, and then adjust accordingly as I manage things on my end.

Load it all in as text initially for example, but if I come and change it to int later, just roll with it and follow the new rule(s).

Thanks for your input @atrauzzi! That makes me think we would need 3 schema update modes:

  • adapt: the incoming type takes priority and the existing column type is updated
  • preserve (your suggestion): the existing type takes priority and the incoming type is ignored
  • fail: if there's a mismatch between the incoming and existing types, we fail

Wdyt @pnadolny13?

edgarrmondragon avatar Dec 17 '24 03:12 edgarrmondragon

Yeah that sounds good. The overall goal in my scenarios are to not have to configure my schema explicitly in meltano. Instead, I want to delegate that entirely to meltano. That way if my source data schema changes, I'm not having to make config changes.

I might rename your two options to be a bit more explicit, as the effect can be ambiguous depending on perspective:

  • sync-target-schema
  • prefer-target-schema

Also, two friendly reminders:

  • With prefer-target-schema, I would still rely on meltano to create the newly discovered columns.
  • I might make columns nullable when I'm manually adjusting types. Might be nice if meltano could support that, versus empty strings

atrauzzi avatar Dec 18 '24 09:12 atrauzzi