:white_check_mark: Solved adding mapper in the mid...
# troubleshooting
j
Solved adding mapper in the middle with explicit reference of fields [tap-mongodb (meltanolabs) target-postgres (meltanolabs)] Hi! I'm tryng ingest data from mongo collection with flattening option enable, I test the output of mongo tap in target-csv Heres the final shape of data on CSV
Copy code
replication_key,object_id,document___id,document__name,document__description,document__lastUpdateDate,document__author,operation_type,cluster_time,namespace__database,namespace__collection
When I tried that with target-postgres (meltanolabs-target-postgres) the data only have that following columns and with the column "document" in blank
Copy code
cluster_time, document, namespace__database, namespace__collection, object_id, operation_type, replication_key, _sdc_batched_at, _sdc_extracted_at, _sdc_received_at, _sdc_deleted_at, _sdc_sequence, _sdc_table_version, _sdc_sync_started_at
On debug mode I see that messages
Copy code
2024-02-09T14:34:29.393703Z [info     ] 2024-02-09 10:34:29,392 | INFO     | target-postgres      | Initializing 'target-postgres' target sink... cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2024-02-09T14:34:29.394653Z [info     ] 2024-02-09 10:34:29,392 | INFO     | target-postgres.col  | Initializing target sink for stream 'col'... cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2024-02-09T14:34:29.742598Z [info     ] 2024-02-09 10:34:29,741 | WARNING  | target-postgres.col  | No schema for record field 'document___id' cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2024-02-09T14:34:29.743499Z [info     ] 2024-02-09 10:34:29,742 | WARNING  | target-postgres.col  | No schema for record field 'document__name' cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2024-02-09T14:34:29.744652Z [info     ] 2024-02-09 10:34:29,742 | WARNING  | target-postgres.col  | No schema for record field 'document__description' cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2024-02-09T14:34:29.745654Z [info     ] 2024-02-09 10:34:29,742 | WARNING  | target-postgres.col  | No schema for record field 'document__lastUpdateDate' cmd_type=elb consumer=True name=target-postgres
 producer=False stdio=stderr string_id=target-postgres
2024-02-09T14:34:29.745654Z [info     ] 2024-02-09 10:34:29,742 | WARNING  | target-postgres.col  | No schema for record field 'document__author' cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
Anyone faced that same situation? Here is my meltano.yml
Copy code
version: 1
default_environment: dev
project_id: 3f9355a7-9ec6-44c3-8269-dcd64e7f9160
environments:
- name: dev
- name: staging
- name: prod
plugins:
  extractors:
  - name: tap-mongodb
    variant: meltanolabs
    pip_url: git+<https://github.com/MeltanoLabs/tap-mongodb.git>
    config:
      mongodb_connection_string: <mongodb://admin:admin@localhost:27017/>
      database: teste3
      metadata:
        '*':
          replication-key: replication_key
          replication-method: INCREMENTAL
      flattening_enabled: true
      flattening_max_depth: 100
    select:
    - col.*
    - document__name
    - col.document__name
  
  loaders:
  - name: target-jsonl
    variant: andyh1203
    pip_url: target-jsonl
    config:
      destination_path: ''
  - name: target-csv
    variant: hotgluexyz
    pip_url: git+<https://github.com/hotgluexyz/target-csv.git>
  - name: target-postgres
    variant: meltanolabs
    pip_url: meltanolabs-target-postgres
    config:
      database: teste123
      host: localhost
      port: 5432
      user: postgres
      default_target_schema: public
      flattening_enabled: true
      flattening_max_depth: 100
  mappers:
  - name: meltano-map-transformer
    variant: meltano
    pip_url: git+<https://github.com/MeltanoLabs/meltano-map-transform.git>
1