public static String toJdbcTableType(String hivetabletype) {
    if (hivetabletype==null) {
      return null;
    } else if (hivetabletype.equals(TableType.MANAGED_TABLE.toString())) {
      return "TABLE";
    } else if (hivetabletype.equals(TableType.VIRTUAL_VIEW.toString())) {
      return "VIEW";
    } else if (hivetabletype.equals(TableType.EXTERNAL_TABLE.toString())) {
      return "EXTERNAL TABLE";
    } else if (hivetabletype.equals(TableType.MATERIALIZED_VIEW.toString())) {
      return "MATERIALIZED VIEW";
    } else {
      return hivetabletype;
    }
  }
Translate hive table types into jdbc table types.
@param hivetabletype
@return the type of the table
jdbc/src/java/org/apache/hive/jdbc/HiveDatabaseMetaData.java