sean_han
03/16/2023, 10:38 PMmeltano run tap-google-sheets target-jsonl, all the selected fields show up in the jsonl file. but if I use meltano run tap-google-sheets target-postgres, some of the selected fields are missing in the target table.andy_carter
03/17/2023, 2:38 AMsean_han
03/17/2023, 5:19 AMsean_han
03/17/2023, 5:24 AMCREATE TABLE staging.sheet1 (
"__sdc_row" numeric NOT NULL,
"__sdc_sheet_id" numeric NULL,
"__sdc_spreadsheet_id" varchar NULL,
"_sdc_batched_at" timestamp NULL,
"_sdc_deleted_at" varchar NULL,
"_sdc_extracted_at" timestamp NULL,
field_a varchar NULL,
field_b varchar NULL,
field_c varchar NULL,
field_d varchar NULL,
CONSTRAINT sheet1_pkey PRIMARY KEY (__sdc_row)
);
CREATE INDEX i_sheet1__sdc_deleted_at ON staging.sheet1 USING btree (_sdc_deleted_at);sean_han
03/17/2023, 5:26 AM2023-03-17T05:22:30.241635Z [info ] INFO Stream: Sheet1, selected_fields: ['__sdc_spreadsheet_id', '__sdc_sheet_id', '__sdc_row', 'id', 'field_a', 'field_b', 'field_c', 'field_d'] cmd_type=elb consumer=False name=tap-google-sheets producer=True stdio=stderr string_id=tap-google-sheetssean_han
03/17/2023, 5:26 AMsean_han
03/17/2023, 5:26 AM{"__sdc_spreadsheet_id": "1Blj-u4-vcMtRoh2obHBBC3b5eBjkCtSDC4NbsmHDrw4", "__sdc_sheet_id": 0, "__sdc_row": 2, "id": "1", "field_a": "a1", "field_b": "b1", "field_c": "c1", "field_d": "d1"}
{"__sdc_spreadsheet_id": "1Blj-u4-vcMtRoh2obHBBC3b5eBjkCtSDC4NbsmHDrw4", "__sdc_sheet_id": 0, "__sdc_row": 3, "id": "2", "field_a": "a2", "field_b": "b2", "field_c": "c2", "field_d": "d2"}
{"__sdc_spreadsheet_id": "1Blj-u4-vcMtRoh2obHBBC3b5eBjkCtSDC4NbsmHDrw4", "__sdc_sheet_id": 0, "__sdc_row": 4, "id": "3", "field_a": "a3", "field_b": "b3", "field_c": "c3", "field_d": "d3"}
{"__sdc_spreadsheet_id": "1Blj-u4-vcMtRoh2obHBBC3b5eBjkCtSDC4NbsmHDrw4", "__sdc_sheet_id": 0, "__sdc_row": 5, "id": "4", "field_a": "a4", "field_b": "b4", "field_c": "c4", "field_d": "d4"}sean_han
03/17/2023, 5:27 AMAndy Carter
03/17/2023, 12:07 PMmeltano.yaml for those two taps?
The implementation will be different for each tap, which explains why some _sdc fields are present in postgres but not in jsonl, that's up to the tap developer's implementation as to what gets added to the output.
Of the non-sdc fields, it looks like id is missing from postgres which is odd. Is id actually a column in your sheet, or just the row number?sean_han
03/17/2023, 4:52 PMsean_han
03/17/2023, 4:54 PM- name: target-postgres-application
inherit_from: target-postgres
config:sean_han
03/17/2023, 4:54 PM- name: target-jsonl
variant: andyh1203
pip_url: target-jsonlsean_han
03/17/2023, 4:56 PM- name: target-postgres
variant: transferwise
pip_url: pipelinewise-target-postgresAndy Carter
03/17/2023, 7:42 PMsean_han
03/17/2023, 9:14 PMsean_han
03/17/2023, 9:14 PMandy_carter
03/18/2023, 9:15 AM--full-refresh when running?sean_han
03/18/2023, 7:45 PMsean_han
03/21/2023, 4:28 PMAndy Carter
03/21/2023, 10:05 PMid column? Do all columns load ok?Andy Carter
03/21/2023, 10:13 PMid but it is not the primary key, perhaps that is forbidden? Can you try to explicitly set id as the key for the plugin? As always drop the table in postgres before rebuilding
metadata:
Sheet1:
key-properties: idsean_han
03/21/2023, 11:48 PMsean_han
03/21/2023, 11:51 PMplugins:
extractors:
- name: tap-google-sheets
variant: singer-io
pip_url: git+<https://github.com/singer-io/tap-google-sheets.git>
config:
client_id: {client id}
spreadsheet_id: {sheet id}
start_date: '2022-01-01T00:00:00Z'
loaders:
- name: target-postgres
variant: transferwise
pip_url: pipelinewise-target-postgres
config:
host: ${DATA_WAREHOUSE_HOST}
port: ${DATA_WAREHOUSE_PORT}
user: ${DATA_WAREHOUSE_USER_NAME}
dbname: ${DATA_WAREHOUSE_DB_NAME}Andy Carter
03/22/2023, 7:28 AMmetadata approach of setting the PK manually, then I'm all out of ideas. I would raise the issue over at the target-postgres reposean_han
03/23/2023, 7:12 PMsean_han
03/23/2023, 7:13 PMmetadata ? I would like to know what are the detail configuration in it.andy_carter
03/23/2023, 10:38 PMandy_carter
03/23/2023, 10:38 PMandy_carter
03/23/2023, 10:39 PMsean_han
03/24/2023, 1:24 AMsean_han
03/24/2023, 1:25 AMsean_han
03/24/2023, 1:25 AMkey-properties is documented? I didn't see it.daniel_walker
04/12/2023, 5:10 PM