private static Path getTableLocationPath(final HiveConf hconf, final TableDesc tableDesc) {
    Table table = null;
    try {
      Hive hive = Hive.get(hconf);
      table = hive.getTable(tableDesc.getTableName());
    } catch (HiveException e) {
      LOG.warn("Unable to get the table location path for: " + tableDesc.getTableName(), e);
    }

    return (table != null) ? table.getPath() : null;
  }
Returns the table location path from a TableDesc object.

@param hconf Configuration object.
@param tableDesc Table description from where to get the table name.
@return The path where the table is located.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java