Hi I am trying to configure `target-snowflake` as ...
# plugins-general
a
Hi I am trying to configure
target-snowflake
as the loader. Is there any sample to verify configs
p
Hey @ashish_kumar - we have target snowflake installed in our meltano instance. See https://gitlab.com/meltano/squared/-/blob/master/data/meltano.yml#L194 and https://gitlab.com/meltano/squared/-/blob/master/data/environments.meltano.yml#L29 for configuration details. We split some stuff across the global plugin settings and environment level settings, thats why its in two places
a
Thanks I will have a look.Do we have any guide to configure mongodb as source and snowflake as target. My source is
tap-mongodb.
How can i define which collections to select data from which can be loaded to snowflake.
p
We're in the process of writing a snowflake guide but not yet, you can check out https://hub.meltano.com/loaders/snowflake also. I'm not familiar with tap-mongodb but there was this thread yesterday of someone getting it set up https://meltano.slack.com/archives/C01TCRBBJD7/p1651001953754839 maybe check that out if you hit a similar issue.
a
I am able to setup everything correctly but when i execute
meltano elt tap-mongodb target-snowflake --job_id=mongodb-to-snowflake
it ends up error like this
Copy code
2022-04-27T15:35:42.980628Z [info     ] Environment 'dev' is active
2022-04-27T15:35:44.854645Z [info     ] Running extract & load...      job_id=mongodb-to-snowflake name=meltano run_id=3c9625f6-7690-4941-8b80-66fde46b3649
2022-04-27T15:35:45.163477Z [warning  ] No state was found, complete import.
2022-04-27T15:36:00.018154Z [info     ] time=2022-04-27 21:06:00 name=target_snowflake level=INFO message=Getting catalog objects from table cache... cmd_type=loader job_id=mongodb-to-snowflake name=target-snowflake run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:02.411455Z [info     ] INFO Connected to MongoDB host: localhost:27017, version: 4.4.13 cmd_type=extractor job_id=mongodb-to-snowflake name=tap-mongodb run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:02.412745Z [info     ] INFO                           cmd_type=extractor job_id=mongodb-to-snowflake name=tap-mongodb run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:02.413358Z [info     ]                                cmd_type=extractor job_id=mongodb-to-snowflake name=tap-mongodb run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:02.413693Z [info     ] +Sync Summary-----------+--------------------+---------------+-------------+------------+-----------------+-----------------------+--------------------------+ cmd_type=extractor job_id=mongodb-to-snowflake name=tap-mongodb run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:02.413986Z [info     ] | database | collection | replication method | total records | write speed | total time | schemas written | schema build duration | percent building schemas | cmd_type=extractor job_id=mongodb-to-snowflake name=tap-mongodb run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:02.414283Z [info     ] +----------+------------+--------------------+---------------+-------------+------------+-----------------+-----------------------+--------------------------+ cmd_type=extractor job_id=mongodb-to-snowflake name=tap-mongodb run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:06.423487Z [info     ] time=2022-04-27 21:06:06 name=target_snowflake level=WARNING message=No columns discovered in the schema "ANALYSIS.MELTANO_ASHISH" cmd_type=loader job_id=mongodb-to-snowflake name=target-snowflake run_id=3c9625f6-7690-4941-8b80-66fde46b3649 stdio=stderr
2022-04-27T15:36:06.548943Z [info     ] Extract & load complete!       job_id=mongodb-to-snowflake name=meltano run_id=3c9625f6-7690-4941-8b80-66fde46b3649
2022-04-27T15:36:06.549130Z [info     ] Transformation skipped.        job_id=mongodb-to-snowflake name=meltano run_id=3c9625f6-7690-4941-8b80-66fde46b3649
p
what is the error exactly? I didnt see any error messages. You can try running
meltano --log-level=debug invoke tap-mongodb
to see if youre getting data out of mongodb prior to loading it to snowflake, the debug logs might tell you more of whats going on
a
In
meltano.yml
file how can i add which table is to be selected
Copy code
extractors:
      - name: tap-mongodb
        select:
        - tags.*
        metadata:
          '*':
            replication-method: FULL_TABLE
p
a
2022-04-27T15:49:32.038863Z [debug    ] Setting '.streams[3].metadata[0].metadata.selected' to 'False'
2022-04-27T15:49:32.038890Z [debug    ] Setting '.streams[3].metadata[0].metadata.replication-method' to 'FULL_TABLE'
2022-04-27T15:49:32.038926Z [debug    ] Skipping node at '.streams[3].metadata[0].metadata.table-key-properties[0]'
2022-04-27T15:49:32.038955Z [debug    ] Skipping node at '.streams[3].metadata[0].metadata.database-name'
2022-04-27T15:49:32.038984Z [debug    ] Skipping node at '.streams[3].metadata[0].metadata.row-count'
2022-04-27T15:49:32.039014Z [debug    ] Skipping node at '.streams[3].metadata[0].metadata.is-view'
2022-04-27T15:49:32.039044Z [debug    ] Skipping node at '.streams[3].metadata[0].metadata.valid-replication-keys[0]'
2022-04-27T15:49:32.039074Z [debug    ] Skipping node at '.streams[3].metadata[0].metadata.selected'
2022-04-27T15:49:32.039104Z [debug    ] Skipping node at '.streams[3].metadata[0].metadata.replication-method'
2022-04-27T15:49:32.039134Z [debug    ] Skipping node at '.streams[3].tap_stream_id'
2022-04-27T15:49:32.039167Z [debug    ] Skipping node at '.streams[3].schema.type'
2022-04-27T15:49:32.039196Z [debug    ] Skipping node at '.streams[3].selected'
2022-04-27T15:49:32.039224Z [debug    ] Skipping node at '.streams[3].replication_method'
Running
meltano --log-level=debug invoke tap-mongodb
gives output as above
tap-mongodb --config config.json --discover > catalog.json
Is there any clue to this error I am having hard time to fix this:
Copy code
time=2022-04-28 19:28:41 name=singer level=CRITICAL message=localhost:27017: [Errno 54] Connection reset by peer
Traceback (most recent call last):
  File "/Users/ashishkumar/Desktop/meltano/.venv/bin/tap-mongodb", line 8, in <module>
    sys.exit(main())
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/tap_mongodb/__init__.py", line 395, in main
    raise exc
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/tap_mongodb/__init__.py", line 392, in main
    main_impl()
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/tap_mongodb/__init__.py", line 379, in main_impl
    client.server_info().get('version', 'unknown'))
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1656, in server_info
    return self.admin.command("buildinfo",
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/pymongo/database.py", line 654, in command
    with self.__client._socket_for_reads(
  File "/Users/ashishkumar/opt/anaconda3/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/pymongo/mongo_client.py", line 1135, in _socket_for_reads
    server = topology.select_server(read_preference)
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/pymongo/topology.py", line 224, in select_server
    return random.choice(self.select_servers(selector,
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/pymongo/topology.py", line 183, in select_servers
    server_descriptions = self._select_servers_loop(
  File "/Users/ashishkumar/Desktop/meltano/.venv/lib/python3.9/site-packages/pymongo/topology.py", line 199, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 54] Connection reset by peer