Source:
<code>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: <START> undeterminedPartitions.add(partitionInfo.getName()); <END> 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; }</code><technical_language>undetermined partitions workers talk metastore a partition exists not. I if need UNKNOWN state. Workers send set of partitions added data of partition exists not. Driver gather partitions workers, consolidate commit partitions. work</technical_language>

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; }