You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/09/04 01:05:00 UTC
[jira] [Work logged] (GOBBLIN-865) Add feature that enables
PK-chunking in partition
[ https://issues.apache.org/jira/browse/GOBBLIN-865?focusedWorklogId=305999&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-305999 ]
ASF GitHub Bot logged work on GOBBLIN-865:
------------------------------------------
Author: ASF GitHub Bot
Created on: 04/Sep/19 01:04
Start Date: 04/Sep/19 01:04
Worklog Time Spent: 10m
Work Description: arekusuri commented on pull request #2722: GOBBLIN-865: Add feature that enables PK-chunking in partition
URL: https://github.com/apache/incubator-gobblin/pull/2722#discussion_r319713269
##########
File path: gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
##########
@@ -146,6 +156,95 @@ protected void addLineageSourceInfo(SourceState sourceState, SourceEntity entity
@Override
protected List<WorkUnit> generateWorkUnits(SourceEntity sourceEntity, SourceState state, long previousWatermark) {
+ String partitionType = state.getProp(PARTITION_TYPE, "PK_CHUNKING");
+ if (partitionType.equals("PK_CHUNKING")) {
+ return generateWorkUnitsPkChunking(sourceEntity, state, previousWatermark);
+ } else {
+ return generateWorkUnitsStrategy(sourceEntity, state, previousWatermark);
+ }
+ }
+
+ /**
+ * generate workUnit with noQuery=true
+ */
+ private List<WorkUnit> generateWorkUnitsPkChunking(SourceEntity sourceEntity, SourceState state, long previousWatermark) {
+ List<SalesforceExtractor.BatchIdAndResultId> batchIdAndResultIds = executeQueryWithPkChunking(state, previousWatermark);
+ List<WorkUnit> ret = createWorkUnits(sourceEntity, state, batchIdAndResultIds);
+ return ret;
+ }
+
+ private List<SalesforceExtractor.BatchIdAndResultId> executeQueryWithPkChunking(
+ SourceState sourceState,
+ long previousWatermark
+ ) throws RuntimeException {
+ Properties commonProperties = sourceState.getCommonProperties();
+ Properties specProperties = sourceState.getSpecProperties();
+ State state = new State();
+ state.setProps(commonProperties, specProperties);
+ WorkUnit workUnit = WorkUnit.createEmpty();
+ try {
+ WorkUnitState workUnitState = new WorkUnitState(workUnit, state);
+ workUnitState.setId("test" + new Random().nextInt());
+ workUnitState.setProp(ENABLE_PK_CHUNKING_KEY, true); // set extractor enable pk chunking
+ int chunkSize = workUnitState.getPropAsInt(PARTITION_PK_CHUNKING_SIZE, DEFAULT_PK_CHUNKING_SIZE);
Review comment:
I was thinking we may want to keep 2nd level PK-chunking and better have different property for them.
As we discussed, we don't think 2nd level PK-chunking makes sense. Will remove this property.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Issue Time Tracking
-------------------
Worklog Id: (was: 305999)
Time Spent: 1h 50m (was: 1h 40m)
> Add feature that enables PK-chunking in partition
> --------------------------------------------------
>
> Key: GOBBLIN-865
> URL: https://issues.apache.org/jira/browse/GOBBLIN-865
> Project: Apache Gobblin
> Issue Type: Task
> Reporter: Alex Li
> Priority: Major
> Labels: salesforce
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> In SFDC(salesforce) connector, we have partitioning mechanisms to split a giant query to multiple sub queries. There are 3 mechanisms:
> * simple partition (equally split by time)
> * dynamic pre-partition (generate histogram and split by row numbers)
> * user specified partition (set up time range in job file)
> However there are tables like Task and Contract are failing time to time to fetch full data.
> We may want to utilize PK-chunking to partition the query.
>
> The pk-chunking doc from SFDC - [https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/async_api_headers_enable_pk_chunking.htm]
--
This message was sent by Atlassian Jira
(v8.3.2#803003)