14
loading...
This website collects cookies to deliver better user experience
meltano elt
with an operator that kicks off some kind of Spark processing job pointed at the same data warehouse or other storage location targeted by Meltanopython3 -m venv venv
source venv/bin/activate
# to avoid any issues during the installation we will update pip
pip install -U pip
pip install meltano
dags
meltano init dags
docker run --name db -e POSTGRES_PASSWORD=password -e POSTGRES_DB=datadb -p 5432:5432 -d postgres
postgres
and will create a database called datadb
. For more details, you can check the officianl PostgreSQL docker page https://hub.docker.com/_/postgres. Remember that you might need sudo
to run docker in linux. pgcli
(venv) user@computer:~/dags$ pgcli -h localhost -u postgres -d datadb
Password for postgres:
Server: PostgreSQL 13.3 (Debian 13.3-1.pgdg100+1)
Version: 2.2.0
postgres@localhost:datadb>
ctrl+d
to exit pgcli or pretty much anything).values.csv
in the extract folder (this folder was created by meltano when initialising the dags
project).echo $'id,text,value\n1,hello,34\n2,bye,65' > extract/values.csv
meltano discover extractors
meltano add extractor tap-csv --variant=meltano
meltano invoke tap-csv --version
meltano add loader target-postgres
meltano.yml
file that meltano created within the dags
folder when we initialised it.version: 1
send_anonymous_usage_stats: false
project_id: 59aca8ad-597d-47fc-a9f4-f1327774bd55
plugins:
extractors:
- name: tap-csv
variant: meltano
pip_url: git+https://gitlab.com/meltano/tap-csv.git
config:
files:
- entity: values
file: extract/values.csv
keys:
- id
loaders:
- name: target-postgres
variant: transferwise
pip_url: pipelinewise-target-postgres
config:
host: localhost
port: 5432
user: postgres
dbname: datadb
echo 'export TARGET_POSTGRES_PASSWORD=password' > .env
elt
command. We will skip the transformation (dbt) step for now.meltano elt tap-csv target-postgres --transform=skip
pgcli
(venv) user@computer:~/dags$ pgcli -h localhost -u postgres -d datadb
Server: PostgreSQL 13.3 (Debian 13.3-1.pgdg100+1)
Version: 2.2.0
postgres@localhost:datadb> select * from tap_csv.values
+------+--------+---------+
| id | text | value |
|------+--------+---------|
| 1 | hello | 34 |
| 2 | bye | 65 |
+------+--------+---------+
SELECT 2
Time: 0.012s
postgres@localhost:datadb>
tap-csv
variant (meltanolabs). The issue was related to that tap not being able to use the discovery functionality but there was next to nothing information about how to solve it and I couldn't find a single step by step tutorial neither. This worries me a bit but it could be a matter of my lack of experience with singer. However, while looking into singer, the number one issue flagged by the community is how open source taps tend to be buggy and they need to be used carefully.