ashish_datta
11/26/2020, 8:28 PMmeltano --log-level=debug elt tap-csv target-postgres --job_id=csv-postgres
and it looks like the tap is working as expected, I see debug records like:
tap-csv (out) | {"type": "RECORD", "stream": "yellow_cabs", "record": {"69934": "628", "2020-11-24 10:59:36": "2017-01-03 13:37:15", "381": "1", "8944": "NULL", "4479": "NULL", "ADD_ANSWER": "LOGIN", "NULL": "NULL", "26189": "NULL", "127.0.0.1": "50.136.93.146"}}
but when it gets to the load I'm getting:
target-postgres | ERROR Exception writing records
target-postgres | Traceback (most recent call last):
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/postgres.py", line 295, in write_batch
target-postgres | written_batches_details = self.write_batch_helper(cur,
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/sql_base.py", line 808, in write_batch_helper
target-postgres | for table_batch in denest.to_table_batches(schema, key_properties, records):
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/denest.py", line 20, in to_table_batches
target-postgres | table_schemas = _get_streamed_table_schemas(schema,
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/denest.py", line 47, in _get_streamed_table_schemas
target-postgres | key_prop_schemas[key] = schema['properties'][key]
target-postgres | KeyError: 'id'
target-postgres | CRITICAL ('Exception writing records', KeyError('id'))
target-postgres | Traceback (most recent call last):
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/postgres.py", line 295, in write_batch
target-postgres | written_batches_details = self.write_batch_helper(cur,
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/sql_base.py", line 808, in write_batch_helper
target-postgres | for table_batch in denest.to_table_batches(schema, key_properties, records):
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/denest.py", line 20, in to_table_batches
target-postgres | table_schemas = _get_streamed_table_schemas(schema,
target-postgres | File "/home/ashish/workspace/meltano-projects/nyc-taxi-data/.meltano/loaders/target-postgres/venv/lib/python3.8/site-packages/target_postgres/denest.py", line 47, in _get_streamed_table_schemas
target-postgres | key_prop_schemas[key] = schema['properties'][key]
target-postgres | KeyError: 'id'
would appreciate any insight!douwe_maan
12/01/2020, 4:32 PMid key. tap-csv seems to use the first row in the CSV file for column names, but that's not how your CSV was set up. Can you modify the CSV and add a row of column names, with one of them id ?ashish_datta
12/01/2020, 4:48 PMmeltano | INFO Extract & load complete!
awesome, thanks!douwe_maan
12/01/2020, 4:49 PMdouwe_maan
12/01/2020, 4:50 PMashish_datta
12/01/2020, 5:03 PMdouwe_maan
12/01/2020, 5:20 PMkey_properties, but the target won't be able to deduplicate rowsdouwe_maan
12/01/2020, 5:20 PMdouwe_maan
12/01/2020, 5:21 PMashish_datta
12/01/2020, 6:13 PMashish_datta
12/01/2020, 6:14 PMdouwe_maan
12/01/2020, 6:14 PMkeys: [] , though