Hello, I need help! Loading Data from spreadsheets...
# troubleshooting
f
Hello, I need help! Loading Data from spreadsheets and csv to different schemas in Postgres: I'm trying to extract data from three spreadsheets(xls,csv) using the
tap-spreadsheets-anywhere
tap and load them into separate schemas in a Postgres database with
target-postgres
. Here's my current configuration:
Copy code
- name: tap-spreadsheets-anywhere
    variant: ets
    pip_url: git+<https://github.com/ets/tap-spreadsheets-anywhere.git>
    config:
      tables:
      - path: <file://data/landing/santander/debito>
        name: source1
        pattern: .csv
        key_properties: []
        format: csv
        start_date: '2024-01-01T00:00:00Z'
        skip_initial: 8
        field_names: [fecha, referencia, concepto, descripcion, debito, credito, saldos]

      - path: <file://data/landing/itau/debito>
        name: source2
        pattern: .xls
        key_properties: []
        format: excel
        worksheet_name: Estado de Cuenta
        start_date: '2024-01-01T00:00:00Z'
        skip_initial: 6

      - path: <file://data/landing/scotia/debito>
        name: source3
        pattern: .csv
        field_names: [suc, fecha, fecha_valor, descripcion, comprobante, debito, credito]
        key_properties: []
        format: csv
        start_date: '2024-01-01T00:00:00Z'
        skip_initial: 1
Loading Data (target-postgres): I'm using
target-postgres
to load the data into my Postgres database named
analytics
. Unfortunately, the current configuration loads all data into the same schema. I'd like to modify this so each source gets loaded into a separate schema (e.g.,
source1
,
source2
,
source3
)
Copy code
- name: target-postgres
    variant: meltanolabs
    pip_url: meltanolabs-target-postgres
    config:
      add_record_metadata: true
      database: analytics
      user: init_loader
      port: 5432
      host: localhost
Could someone please advise on how to configure
target-postgres
to load each data source into its own dedicated schema within the Postgres database?
d
Set the
load_schema
property on the extractor
a
Or set
default_target_schema: ${MELTANO_EXTRACTOR_NAMESPACE}
on your
target-postgres
config to get separate schemas based on the tap names. If you want this to work with
tap-spreadsheets-anywhere
you might need to create a new inherited tap from the parent and rename it, so you have a
tap-spreadsheets-anywhere
with no config, and then
tap-santander
,
tap-itau
with one table in each.
👍 1
f
@Andy Carter I am new with Meltano. Can you share me an example of config with inhereted tap?
👍 1
a
De nada, if you get stuck feel free to share back here.