use of io.trino.plugin.hive.LocationHandle.WriteMode in project trino by trinodb.
the class HiveLocationService method getPartitionWriteInfo.
@Override
public WriteInfo getPartitionWriteInfo(LocationHandle locationHandle, Optional<Partition> partition, String partitionName) {
if (partition.isPresent()) {
// existing partition
WriteMode writeMode = locationHandle.getWriteMode();
Path targetPath = new Path(partition.get().getStorage().getLocation());
Path writePath = getPartitionWritePath(locationHandle, partitionName, writeMode, targetPath);
return new WriteInfo(targetPath, writePath, writeMode);
} else {
// new partition
return new WriteInfo(new Path(locationHandle.getTargetPath(), partitionName), new Path(locationHandle.getWritePath(), partitionName), locationHandle.getWriteMode());
}
}
Aggregations