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.
-
After digging in a bit this is how I understand it:
default_target_schema
it will override any schema name that came from the mysql source. For example the mysql tableschema_1.table_1
gets translated into the stream nameschema_1-table_1
and with the settingdefault_target_schema=my_schema_override
it would create a table in snowflake calledtable_1
within themy_schema_override
schema. Similarly if you kept the same settings and synced ``schema_2-table_1it would append to the
table_1` table in snowflake like you described.default_target_schema
then it will split the stream name on-
and take the second to last value as the schema name. For exampleschema_1.table_1
would again become the streamschema_1-table_1
and would create a table in snowflake calledtable_1
within the schemaschema_1
. Then syncingschema_2-table_1
you'd see another schema in snowflake get createdschema_1
withintable_1
inside it.default_target_schema
for 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 beNone
if it would act the same way as I described above 🤔 .Beta Was this translation helpful? Give feedback.
All reactions