code: protected static Path resolvePath(String pattern, String database, String table) {
      pattern = pattern.replace(HiveDataset.DATABASE_TOKEN, database);
      if (pattern.contains(HiveDataset.TABLE_TOKEN)) {
        pattern = pattern.replace(HiveDataset.TABLE_TOKEN, table);
        return new Path(pattern);
      } else {
        return new Path(pattern, table);
      }
    }
docs: Takes a path with tokens {@link #databaseToken} or {@link #tableToken} and replaces these tokens with the actual
  database names and table name. For example, if db is myDatabase, table is myTable, then /data/$DB/$TABLE will be
  resolved to /data/myDatabase/myTable.