joshua_janicas
07/12/2023, 4:33 PMtarget-snowflake
. Meltano was able to create the tables in my Warehouse, but when it tries to load data, it fails out.
I have previously been testrunning these ingestion activities via the same mssql tap and the target-jsonl
package and was able to execute without issue into JSONL.
Details in 🧵 !joshua_janicas
07/12/2023, 4:35 PMjoshua_janicas
07/12/2023, 4:36 PMplugins:
extractors:
- name: tap-mssql
variant: buzzcutnorman
pip_url: git+<https://github.com/BuzzCutNorman/tap-mssql.git>
config:
dialect: mssql
driver_type: pyodbc
host: 127.0.0.1,4433
port: 1433
user: abc
database: xyz
sqlalchemy_eng_params:
fast_executemany: 'True'
sqlalchemy_url_query:
driver: ODBC Driver 17 for SQL Server
TrustServerCertificate: yes
- name: tap-mssql-content
inherit_from: tap-mssql
select:
- Content-ResourceUpdate.*
- Content-*LocationUpdate.*
loaders:
- name: target-snowflake
variant: meltanolabs
pip_url: meltanolabs-target-snowflake
config:
account: abc
add_record_metadata: true
database: TS
user: MELTANO_USER
role: MELTANO_ROLE
warehouse: TS_Warehouse
default_target_schema: ${MELTANO_EXTRACT__LOAD_SCHEMA} # Default Schema that Meltano, can be adjusted
joshua_janicas
07/12/2023, 4:37 PM2023-07-12T16:02:21.858773Z [info ] sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 253006: 253006: File doesn't exist: ['C:GitHubETLRedesignmeltano-projectMeltanoV2\target-snowflake--Content-ResourceLocationUpdate-c1b6705a-fbbc-4965-ae9c-3cf50ee17296-1.json.gz'] cmd_type=elb
consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-07-12T16:02:21.859776Z [info ] [SQL: put '<file://C>:\GitHub\ETLRedesign\meltano-project\MeltanoV2\target-snowflake--Content-ResourceLocationUpdate-c1b6705a-fbbc-4965-ae9c-3cf50ee17296-1.json.gz' '@~/target-snowflake/Content-ResourceLocationUpdate-e3a47dbf-2469-4bda-a986-9c91e1cd1b79'] cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-07-12T16:02:21.860774Z [info ] (Background on this error at: <https://sqlalche.me/e/14/f405>) cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2023-07-12T16:02:21.861775Z [info ] """
joshua_janicas
07/12/2023, 4:38 PMtaylor
07/12/2023, 4:50 PMvisch
07/12/2023, 4:53 PMC:GitHubETLRedesignmeltano-projectMeltanoV2
doesn't have slashes which seems like it could be the issue here
2. Windows can complain if file paths are really really long (I think it's #1 though)joshua_janicas
07/12/2023, 4:53 PMmelatno run tap-mssql-content target-snowflake
visch
07/12/2023, 4:54 PMSQL: put '<file://C>:\GitHub\ETLRedesign\meltano-project\MeltanoV2\target-snowflake--Content-ResourceLocationUpdate-c1b6705a-fbbc-4965-ae9c-3cf50ee17296-1.json.gz' '@~/target-snowflake/Content-ResourceLocationUpdate-e3a47dbf-2469-4bda-a986-9c91e1cd1b79']
Makes me question it being #1 thoughuser
07/12/2023, 4:54 PMvisch
07/12/2023, 4:55 PMjoshua_janicas
07/12/2023, 4:56 PMtaylor
07/12/2023, 5:05 PMvisch
07/12/2023, 5:11 PMvisch
07/12/2023, 5:12 PMtarget-snowflake
and see if you get a replicated error?BuzzCutNorman
07/12/2023, 5:24 PMbatch_config
to tap-snowflake
. Here is an example one to use as a template.
loaders:
- name: target-snowflake
variant: meltanolabs
pip_url: meltanolabs-target-snowflake
config:
account: abc
add_record_metadata: true
database: TS
user: MELTANO_USER
role: MELTANO_ROLE
warehouse: TS_Warehouse
default_target_schema: ${MELTANO_EXTRACT__LOAD_SCHEMA} # Default Schema that Meltano, can be adjusted
batch_config:
encoding:
format: jsonl
compression: gzip
storage:
root: "<file://c>://GitHub/ETLRedesign/batches"
joshua_janicas
07/12/2023, 5:29 PMjoshua_janicas
07/12/2023, 5:31 PMpat_nadolny
07/12/2023, 5:31 PM'C:GitHubETLRedesignmeltano-projectMeltanoV2
. The root input default for the target is current working directory so its generating that part automatically somewhereBuzzCutNorman
07/12/2023, 5:36 PM"
in around the root:
locationjoshua_janicas
07/12/2023, 5:37 PM"
😞BuzzCutNorman
07/12/2023, 6:06 PMroot: C:\GitHub\ETLRedesign\batches
BuzzCutNorman
07/12/2023, 6:08 PMc:\development\projects\batches
and it worked. Since target-snowflake
is leveraging the same functions maybe it will work.joshua_janicas
07/12/2023, 6:09 PM'
and "
and still returning the same error code with the \b
being represented as \x08
(e.g.)`\x08atches\target-snowflake`
sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 253006: 253006: File doesn't exist: ['c:GitHubETLRedesign\x08atches\target-snowflake--Content-ResourceUpdate-1dd772ee-39e5-4eca-a5da-b2086dca122a-1.json.gz'
Trying the new root is still giving me the same problem. Is it maybe a python specific version issue? I am currently on 3.10joshua_janicas
07/12/2023, 6:11 PMBuzzCutNorman
07/12/2023, 6:18 PM\b
is a backspace so maybe change to root: C:\GitHub\ETLRedesign\snowballs
joshua_janicas
07/12/2023, 6:21 PMuser
07/12/2023, 6:44 PMjoshua_janicas
07/12/2023, 6:49 PM\/
, \\
. In every case it produces the files but then somewhere eats the slashes and can't find the file anymore c:GitHubETLRedesign\x08atches\target-snowflake--Content
root: "<file://c>://GitHub//ETLRedesign//batches"
root: "<file://c>:\\GitHub\\ETLRedesign\\batches"
root: "<file://c>:\/GitHub\/ETLRedesign\/batches"
root: c:\\GitHub\\ETLRedesign\\batches
root: "c:\\GitHub\\ETLRedesign\\batches"
user
07/12/2023, 7:06 PMroot: <file://C>:/GitHub/ETLRedesign/batches
can you see what that says?joshua_janicas
07/12/2023, 7:13 PMfs.opener.errors.UnsupportedProtocol: protocol '<file' is not supported
user
07/12/2023, 7:15 PM<
or is it adding it automatically? I have "root": "<file://C>:/GitHub/ETLRedesign/batches"
in my config and its just building the wrong file path for me but the slashes are correct so I thought maybe that would helpjoshua_janicas
07/12/2023, 7:17 PMjoshua_janicas
07/12/2023, 7:18 PMpat_nadolny
07/12/2023, 7:20 PM<
I'm meaning to say "root": "<file://C>:/GitHub/ETLRedesign/batches"
without <
joshua_janicas
07/12/2023, 7:22 PMsqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 253006: 253006: File doesn't exist: ['C:GitHubETLRedesign\x08atches\target-snowflake--Content-ResourceUpdate-1825b227-8fde-4f64-b8ef-35321edac790-1.json.gz']
joshua_janicas
07/12/2023, 7:23 PMpat_nadolny
07/12/2023, 7:33 PMvisch
07/13/2023, 4:21 PMsqlalchemy.Text
I used a bound parameter instead and it works. Not sure if we want to expand bound parameters to entire target or not but this works!
C:GitHubETLRedesignmeltano-projectMeltanoV2\target-snowflake--Content-ResourceLocationUpdate-c1b6705a-fbbc-4965-ae9c-3cf50ee17296-1.json.gz
user
07/13/2023, 7:27 PMmeltano install loader target-snowflake --clean
to pull in the latest, assuming you havent pinned your pip_url in your meltano.yml (obvious update that first if you do have it pinned).joshua_janicas
07/13/2023, 7:31 PM