Source:
protected RecordUpdater getRecordUpdater(List<String> partitionValues, int bucketId) throws StreamingIOFailure { RecordUpdater recordUpdater; String key; Path destLocation; try { key = partitionValues == null ? fullyQualifiedTableName : partitionValues.toString(); if (partitionPaths.containsKey(key)) { destLocation = partitionPaths.get(key); } else { if (partitionValues == null) { destLocation = new Path(table.getSd().getLocation()); } else { PartitionInfo partitionInfo = conn.createPartitionIfNotExists(partitionValues); switch(partitionInfo.getExists()) { case NOT_EXISTS: addedPartitions.add(partitionInfo.getName()); if (LOG.isDebugEnabled()) { LOG.debug("Created partition for table {}", partitionInfo.getName(), fullyQualifiedTableName); } break; case EXISTS: if (LOG.isDebugEnabled()) { LOG.debug("Partition already exists for table {}", partitionInfo.getName(), fullyQualifiedTableName); } break; case UNKNOWN: undeterminedPartitions.add(partitionInfo.getName()); if (LOG.isDebugEnabled()) { LOG.debug("Couldn't determine if partition with values for" + " table exists", partitionValues, fullyQualifiedTableName); } break; default: } destLocation = new Path(partitionInfo.getPartitionLocation()); } partitionPaths.put(key, destLocation); } updaters.computeIfAbsent(key, k -> initializeBuckets()); recordUpdater = updaters.get(key).get(bucketId); } catch (StreamingException e) { throw new StreamingIOFailure("Unable to create partition: " + partitionValues + "for " + conn, e); } if (recordUpdater == null) { try { recordUpdater = createRecordUpdater(destLocation, bucketId, curBatchMinWriteId, curBatchMaxWriteId); } catch (IOException e) { String errMsg = "Failed creating RecordUpdater for " + getWatermark(destLocation.toString()); LOG.error(errMsg, e); throw new StreamingIOFailure(errMsg, e); } List<RecordUpdater> partitionUpdaters = updaters.get(key); partitionUpdaters.set(bucketId, recordUpdater); } return recordUpdater; }

Target:
protected RecordUpdater getRecordUpdater(List<String> partitionValues, int bucketId) throws StreamingIOFailure { RecordUpdater recordUpdater; String key; Path destLocation; try { key = partitionValues == null ? fullyQualifiedTableName : partitionValues.toString(); if (partitionPaths.containsKey(key)) { destLocation = partitionPaths.get(key); } else { if (partitionValues == null) { destLocation = new Path(table.getSd().getLocation()); } else { PartitionInfo partitionInfo = conn.createPartitionIfNotExists(partitionValues); if (!partitionInfo.isExists()) { addedPartitions.add(partitionInfo.getName()); } else { if (LOG.isDebugEnabled()) { LOG.debug("Partition already exists for table {}", partitionInfo.getName(), fullyQualifiedTableName); } } destLocation = new Path(partitionInfo.getPartitionLocation()); } partitionPaths.put(key, destLocation); } updaters.computeIfAbsent(key, k -> initializeBuckets()); recordUpdater = updaters.get(key).get(bucketId); } catch (StreamingException e) { throw new StreamingIOFailure("Unable to create partition: " + partitionValues + "for " + conn, e); } if (recordUpdater == null) { try { recordUpdater = createRecordUpdater(destLocation, bucketId, curBatchMinWriteId, curBatchMaxWriteId); } catch (IOException e) { String errMsg = "Failed creating RecordUpdater for " + getWatermark(destLocation.toString()); LOG.error(errMsg, e); throw new StreamingIOFailure(errMsg, e); } List<RecordUpdater> partitionUpdaters = updaters.get(key); partitionUpdaters.set(bucketId, recordUpdater); } return recordUpdater; }