public static Path fullyQualifiedHDFSUri(Path input, FileSystem hdfsFileSystem)
      throws SemanticException {
    URI uri = input.toUri();
    String scheme = hdfsFileSystem.getScheme();
    String authority = hdfsFileSystem.getUri().getAuthority();
    String path = uri.getPath();
    try {
      return new Path(new URI(scheme, authority, path, null, null));
    } catch (URISyntaxException e) {
      throw new SemanticException(ErrorMsg.INVALID_PATH.getMsg(), e);
    }
  }
Path builder to stitch together paths with different components might be useful as utils across
replication semantic analyzer atleast.
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/PathBuilder.java