-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addition of Upsert operation in Salesforce sink Plugin #17
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,14 +178,14 @@ public static List<JsonObject> queryObject(String id, String objectName) { | |
public static void deletePushTopic(String pushTopicName) { | ||
try { | ||
PartnerConnection partnerConnection = new PartnerConnection( | ||
Authenticator.createConnectorConfig(AuthenticatorCredentials.fromParameters(USERNAME, PASSWORD + SECURITYTOKEN, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the unnecessary/non-targeted changes |
||
CLIENTID, CLIENTSECRET, PluginPropertyUtils. | ||
pluginProp("login.url"), | ||
30000, 3600, ""))); | ||
Authenticator.createConnectorConfig(AuthenticatorCredentials.fromParameters(USERNAME, PASSWORD + SECURITYTOKEN, | ||
CLIENTID, CLIENTSECRET, PluginPropertyUtils. | ||
pluginProp("login.url"), | ||
30000, 3600, ""))); | ||
|
||
QueryResult queryResult = SalesforceStreamingSourceConfig.runQuery( | ||
partnerConnection, | ||
String.format("SELECT Id FROM PushTopic WHERE Name = '%s'", pushTopicName) | ||
partnerConnection, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the unnecessary/non-targeted changes |
||
String.format("SELECT Id FROM PushTopic WHERE Name = '%s'", pushTopicName) | ||
); | ||
|
||
SObject sobject = queryResult.getRecords()[0]; | ||
|
@@ -204,7 +204,7 @@ public static void deletePushTopic(String pushTopicName) { | |
} catch (ConnectionException e) { | ||
String message = SalesforceConnectionUtil.getSalesforceErrorMessageFromException(e); | ||
throw new InvalidStageException( | ||
String.format("Cannot connect to Salesforce API with credentials specified due to error: %s", message), e); | ||
String.format("Cannot connect to Salesforce API with credentials specified due to error: %s", message), e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the unnecessary/non-targeted changes |
||
} | ||
} | ||
|
||
|
@@ -269,7 +269,7 @@ public static String queryObjectId(String objectName) { | |
return uniqueRecordId; | ||
} | ||
|
||
public static void updateObject(String id, String objectName) { | ||
public static void updateObject(String id, String objectName) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the unnecessary/non-targeted changes |
||
getAccessToken(); | ||
HttpClient httpClient = HttpClientBuilder.create().build(); | ||
String baseUri = loginInstanceUrl + REST_ENDPOINT + API_VERSION; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
create table `DATASET.TABLE_NAME` (Id STRING,Name STRING) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
create table `DATASET.TABLE_NAME` (Name STRING, Col_Timestamp__c TIMESTAMP, Col_Date__c DATE, Col_Currency__c FLOAT64, | ||
Col_Email__c STRING, Col_Number__c FLOAT64, Col_GeoLocation__Latitude__s FLOAT64, | ||
Col_GeoLocation__Longitude__s FLOAT64, Col__c STRING, Col_Url__c STRING, Col_Time__c TIME, Col_Text__c STRING) | ||
create table `DATASET.TABLE_NAME` (Id__c FLOAT64, Name STRING, Col_Timestamp__c TIMESTAMP, Col_Date__c DATE, Col_Currency__c FLOAT64, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change done to fix the broken environment dependent tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we have done this change to fix the broken environment dependent tests. |
||
Col_Email__c STRING, Col_Number__c FLOAT64, Col__c STRING, Col_Url__c STRING, Col_Time__c TIME, Col_Text__c STRING) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
insert into `DATASET.TABLE_NAME` (Id ,Name ) values | ||
('abc','Test_PB' ); | ||
|
||
insert into `DATASET.TABLE_NAME` (Id ,Name ) values | ||
('345','Test_PB1' ); | ||
|
||
insert into `DATASET.TABLE_NAME` (Id ,Name ) values | ||
('768','Test_PB23' ); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
insert into `DATASET.TABLE_NAME` (Name, Col_Timestamp__c, Col_Date__c, Col_Currency__c, Col_Email__c, Col_Number__c, | ||
Col_GeoLocation__Latitude__s, Col_GeoLocation__Longitude__s, Col__c, Col_Url__c, Col_Time__c, Col_Text__c) values | ||
('adam','2019-03-10 04:50:01 UTC','2021-01-28',61.823765812,'[email protected]',898365444,37.794116,-122.3432, | ||
insert into `DATASET.TABLE_NAME` (Id__c, Name, Col_Timestamp__c, Col_Date__c, Col_Currency__c, Col_Email__c, Col_Number__c, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change done to fix the broken environment dependent tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we have done this change to fix the broken environment dependent tests. |
||
Col__c, Col_Url__c, Col_Time__c, Col_Text__c) values | ||
(786777,'adam','2019-03-10 04:50:01 UTC','2021-01-28',61.823765812,'[email protected]',-122.3432, | ||
'984746334','abc/123','20:26:34','find'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ invalid.admin.consumer.secret=lmnop891011 | |
#SOQL Query | ||
simple.query=SELECT Id, Name, Phone FROM Account | ||
test.query=SELECT Id,Name,Col_Timestamp__c,Col_Date__c,Col_Currency__c,Col_Email__c,Col_Number__c,\ | ||
Col_GeoLocation__Latitude__s,Col_GeoLocation__Longitude__s,Col__c,Col_Url__c,Col_Time__c,Col_Text__c FROM Automation_custom__c | ||
Col__c,Col_Url__c,Col_Time__c,Col_Text__c FROM Automation_custom__c | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change done to fix the broken environment dependent tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we have done this change to fix the broken environment dependent tests. |
||
where.query=SELECT name FROM Opportunity WHERE StageName='Needs Analysis' | ||
groupby.query=SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId | ||
childtoparent.query=SELECT Id, Name, Account.Name FROM Contact WHERE Account.Industry = 'Chemicals' | ||
|
@@ -29,8 +29,9 @@ opportunity.query=SELECT Id,Name,StageName,AccountId,LastViewedDate,LastReferenc | |
AccountId='0015j00000kN78QAAS' | ||
|
||
sobject.Automation_custom_c=Automation_custom__c | ||
|
||
#SObjects | ||
sobject.account=Account | ||
sobject.account=Automation_custom__c | ||
Salesforce.sobjectName=Opportunity | ||
sobject.lead=Lead | ||
sobject.invalid=abc | ||
|
@@ -50,7 +51,7 @@ hundred.million.records=100000000 | |
topic.name=StreamingSalesforce | ||
#Macros | ||
sfmultisource.listofsobjects=Lead,Opportunity | ||
sfmultisource.listofsobject=Automation_custom__c,Automation_custom2__c | ||
sfmultisource.listofsobject=Automation_custom__c | ||
sfmultisource.sobject.lead=Lead | ||
sfmultisource.sobject.customobject=Automation_custom__c | ||
sfmultisource.listofsobjectsforblacklist=Account,Contact | ||
|
@@ -107,7 +108,7 @@ account.schema= [{"key":"Id","value":"string"},{"key":"IsDeleted","value":"boole | |
{"key":"ParentId","value":"string"},{"key":"BillingStreet","value":"string"},{"key":"BillingCity","value":"string"},\ | ||
{"key":"BillingState","value":"string"},{"key":"BillingPostalCode","value":"string"},\ | ||
{"key":"BillingCountry","value":"string"},\ | ||
{"key":"BillingLatitude","value":"double"},{"key":"BillingLongitude","value":"double"},\ | ||
{"key":"BillingLatitude","value":"double"},{"key":"Billingtest_automation_sfgitude","value":"double"},\ | ||
{"key":"BillingGeocodeAccuracy","value":"string"},{"key":"ShippingStreet","value":"string"},\ | ||
{"key":"ShippingCity","value":"string"},{"key":"ShippingState","value":"string"},\ | ||
{"key":"ShippingPostalCode","value":"string"},{"key":"ShippingCountry","value":"string"},\ | ||
|
@@ -126,15 +127,21 @@ account.schema= [{"key":"Id","value":"string"},{"key":"IsDeleted","value":"boole | |
|
||
CreateBQTableQueryFile=BigQuery/BigQueryCreateTableQuery.txt | ||
InsertBQDataQueryFile=BigQuery/BigQueryInsertDataQuery.txt | ||
BigQueryCreateTableFailureQuery=BigQuery/BigQueryCreateTableFailureQuery.txt | ||
BigQueryInsertDataFailureQuery=BigQuery/BigQueryInsertDataFailureQuery.txt | ||
|
||
bigQueryDatatypesColumnsList=(Id,Name,Col_Timestamp__c,Col_Date__c,Col_Currency__c,Col_Email__c,Col_Number__c,\ | ||
Col_GeoLocation__Latitude__s,Col_GeoLocation__Longitude__s,Col__c,Col_Url__c,Col_Time__c,Col_Text__c) | ||
,Col__c,Col_Url__c,Col_Time__c,Col_Text__c) | ||
|
||
testData={"Name":"hello","Col_Timestamp__c":"2023-06-14T07:04:56.000+0000","Col_Date__c":"2023-06-14",\ | ||
"Col_Currency__c":123.456,"Col_Email__c":"[email protected]","Col_Number__c":1008.0,\ | ||
"Col_GeoLocation__Latitude__s":37.794016,"Col_GeoLocation__Longitude__s":-122.395016,"Col__c":"984746334",\ | ||
"Col_Url__c":"abc/123","Col_Time__c":"05:00:00.000Z","Col_Text__c":"shsss"} | ||
testData={"Id__c" : "123","Name":"hello","Col_Timestamp__c":"2023-06-14T07:04:56.000+0000","Col_Date__c":"2023-06-14","Col_Currency__c":567.789,"Col_Email__c":"[email protected]","Col_Number__c":1008.0,\ | ||
"Col__c":"984746334", "Col_Url__c":"abc/123","Col_Time__c":"05:00:00.000Z","Col_Text__c":"shsss"} | ||
|
||
testObjectData={"Name":"dummy","Col_Timestamp__c":"2023-06-14T07:04:56.000+0000","Col_Date__c":"2023-06-14",\ | ||
"Col_Currency__c":567.789,"Col_Email__c":"[email protected]","Col_Number__c":1008.0,\ | ||
"Col_Url__c":"def/123","Col_Time__c":"05:00:00.000Z","Col_Text__c":"finder","Col_Phone__c":"123567"} | ||
#testData={"Name":"hello","Col_Timestamp__c":"2023-06-14T07:04:56.000+0000","Col_Date__c":"2023-06-14",\ | ||
"Col_Currency__c":123.456,"Col_Email__c":"[email protected]","Col_Number__c":1008.0,\ | ||
"Col__c":"984746334","Col_Url__c":"abc/123","Col_Time__c":"05:00:00.000Z","Col_Text__c":"shsss"} | ||
|
||
url = http://10.132.0.45:3128 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this property used for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Property removed |
||
UpsertColumnvalue=Id__c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are we using this hook?