You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Tao Wu <li...@gmail.com> on 2020/07/13 10:06:35 UTC

Trying to understand how Hive decide whether a table is external

Hi All,

It checks whether the parameters of a table contain an "EXTERNAL" key with
value "TRUE", instead of using the TableType field from the Table object.
Could you please share some insight?

The source code is shown below.

Thank you.
Tao

public static boolean isExternalTable(Table table) {
  if (table == null) {
    return false;
  }
  Map<String, String> params = table.getParameters();
  if (params == null) {
    return false;
  }

  return "TRUE".equalsIgnoreCase(params.get("EXTERNAL"));
}