Search in sources :

Example 1 with WriteMode

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());
    }
}
Also used : HiveWriteUtils.createTemporaryPath(io.trino.plugin.hive.util.HiveWriteUtils.createTemporaryPath) Path(org.apache.hadoop.fs.Path) WriteMode(io.trino.plugin.hive.LocationHandle.WriteMode)

Aggregations

WriteMode (io.trino.plugin.hive.LocationHandle.WriteMode)1 HiveWriteUtils.createTemporaryPath (io.trino.plugin.hive.util.HiveWriteUtils.createTemporaryPath)1 Path (org.apache.hadoop.fs.Path)1