How are source schema names reflected in Snowflake? #92
Replies: 2 comments 2 replies
-
|
@pnadolny13 I think you've got a couple of typos in there. One of which in the second bullet point:
should probably be:
Other than that, I think this is an accurate reflection of the current state. I'm an advocate for being able to pass the source schema name (i.e., the "second to last value" in the stream name when split on |
Beta Was this translation helpful? Give feedback.
-
|
I came across this thread as we have encountered a problem with permissions on existing schemas with matching names. For the scenario:
{
"schema": "new_schema",
}If the Snowflake account doesn't have access to the I think this should possibly be the other way around, i.e.: schema = self.config.get("schema", super().schema_name)if the user supplies a schema then target tables AND file formats should be routed to that schema - if not, use the schema coming from the stream. We have got around this by setting |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After digging in a bit this is how I understand it:
default_target_schemait will override any schema name that came from the mysql source. For example the mysql tableschema_1.table_1gets translated into the stream nameschema_1-table_1and with the settingdefault_target_schema=my_schema_overrideit would create a table in snowflake calledtable_1within themy_schema_overrideschema. Similarly if you kept the same settings and synced ``schema_2-table_1it would append to thetable_1` table in snowflake like you described.default_target_schemathen it will split the stream name on-and take the second to last value as the schema name. For exampleschema_1.table_1would again become the streamschema_1-table_1and would create a table in snowflake calledtable_1within the schemaschema_1. Then syncingschema_2-table_1you'd see another schema in snowflake get createdschema_1withintable_1inside it.default_target_schemafor you by default https://github.com/meltano/hub/blob/36db3f80f6616a4234dcdf1913ac2766ef01c0c4/_data/meltano/loaders/target-snowflake/transferwise.yml#L86. I wonder if you overrode that to beNoneif it would act the same way as I described above 🤔 .Beta Was this translation helpful? Give feedback.
All reactions