public String getNotEmptyDbTable() {
    String metaRefName = tableMetaRef == null ? "" : "." + tableMetaRef;
    return db == null || db.trim().isEmpty() ? table : db + DatabaseName.CAT_DB_TABLE_SEPARATOR + table + metaRefName;
  }
Get the name in db.table format, if db is not empty, otherwise pass only the table name.
storage-api/src/java/org/apache/hadoop/hive/common/TableName.java