jan_soubusta
03/29/2023, 2:55 PM- name: tap-salesforce
variant: meltanolabs
pip_url: git+<https://github.com/meltanolabs/tap-salesforce.git>
select:
- LeadHistory.LeadId
- LeadHistory.CreatedDate
- LeadHistory.Field
- LeadHistory.NewValue
- LeadHistory.OldValue
Columns corresponding to NewValue
and OldValue
are not created in the target table.
Loading to Snowflake.
meltano select tap-salesforce --list
shows these two properties as available and selected.
Any clue what am I doing wrong or how to debug it?visch
03/29/2023, 3:59 PMmeltano invoke tap-salesforce
and see if there is any data with oldvalue / newvalue firstjan_soubusta
03/30/2023, 4:09 PMmeltano select
does not show them as selected. Not sure if they should exist.visch
03/30/2023, 4:13 PMLeadHistory, ContactHistory - New/OldValue fields are tapped OK, target-jsonl proofs it, but they are not loaded into SnowflakeHmm, does the target have a bug or something? Which snowflake target. I'm not a snowflake expert but maybe someone else will be able to see it or maybe I'll get lucky and see it. Another thing you could do just to rule out any caching or something odd is run
meltano invoke tap-salesforce > out
(with leadhistory new/old values, verify they are in this output file)
cat out | meltano invoke target-snowflake
If you still don't get the data into snowflake that you know for sure it's the target causing the issuejan_soubusta
03/30/2023, 4:14 PMjan_soubusta
03/31/2023, 8:16 AMout
contains:
{
"type": "RECORD",
"stream": "LeadHistory",
"record": {
"Id": "0178J00003gKvuIQAS",
"LeadId": "00Q8J000002GdFZUA0",
"CreatedDate": "2023-01-01T19:34:24.000000Z",
"Field": "LeadSource_Original_Text__c",
"OldValue": null,
"NewValue": "GD Cloud Trial Registration"
},
"version": 1680246159725,
"time_extracted": "2023-03-31T07:02:39.734217Z"
}
So Old/NewValue are there.
Then I drop leadhistory
table and run:
cat out | meltano invoke target-postgres
debug:
time=2023-03-31 10:13:50 name=target_postgres level=INFO message=Table '"leadhistory"' does not exist. Creating... CREATE TABLE IF NOT EXISTS sfdc_input_stage."leadhistory" ("createddate" timestamp without time zone, "field" character varying, "id" character varying, "leadid" character varying, "_sdc_batched_at" timestamp without time zone, "_sdc_deleted_at" character varying, "_sdc_extracted_at" timestamp without time zone, PRIMARY KEY ("id"))
Columns Old/NewValue are not created and obviously not loaded.jan_soubusta
03/31/2023, 9:57 AMjan_soubusta
03/31/2023, 10:21 AMjan_soubusta
03/31/2023, 10:31 AM{
"type": "SCHEMA",
"stream": "LeadHistory",
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"Id": {
"type": "string"
},
"LeadId": {
"type": [
"null",
"string"
]
},
"CreatedDate": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": [
"string",
"null"
]
}
]
},
"Field": {
"type": [
"null",
"string"
]
},
"OldValue": {},
"NewValue": {}
}
},
},
jan_soubusta
03/31/2023, 10:32 AMjan_soubusta
03/31/2023, 10:41 AMvisch
03/31/2023, 12:19 PMjan_soubusta
03/31/2023, 12:39 PMdef field_to_property_schema(field, mdata):
......
elif sf_type in LOOSE_TYPES:
return property_schema, mdata # No type = all types
Old/NewValue properties are of LOOSE_TYPE, they are anyType
.
The tap calls this method: property_schema, mdata = salesforce.field_to_property_schema(field, mdata)
jan_soubusta
03/31/2023, 12:40 PMjan_soubusta
03/31/2023, 12:40 PMvisch
03/31/2023, 12:42 PMjan_soubusta
03/31/2023, 12:55 PMjan_soubusta
03/31/2023, 1:03 PMNewValue: 13000 does not match {'type': ['object', 'null']}
Have to list all possible typesjan_soubusta
03/31/2023, 1:08 PMjan_soubusta
03/31/2023, 1:09 PMjan_soubusta
03/31/2023, 1:39 PMbryan_rose
06/12/2023, 6:14 PMjan_soubusta
06/12/2023, 6:21 PMplugins:
extractors:
- name: tap-salesforce
variant: meltanolabs
pip_url: git+<https://github.com/MeltanoLabs/tap-salesforce.git>
config:
api_type: BULK
is_sandbox: ${SALESFORCE_SANDBOX}
select_fields_by_default: false
start_date: "2022-01-01T00:00:00Z"
streams_to_discover:
- Account
- Lead
- LeadHistory
- Contact
- ContactHistory
- Opportunity
- OpportunityHistory
- OpportunityFieldHistory
- Campaign
- CampaignMember
- OpportunityContactRole
- User
- UserRole
- Event
- Task
schema:
LeadHistory:
NewValue:
type: [ "string", "null" ]
OldValue:
type: [ "string", "null" ]
ContactHistory:
NewValue:
type: [ "string", "null" ]
OldValue:
type: [ "string", "null" ]
OpportunityFieldHistory:
NewValue:
type: [ "string", "null" ]
OldValue:
type: [ "string", "null" ]
bryan_rose
06/13/2023, 8:35 PM