@Override
  protected Table getTableObjectByName(String tabName, boolean throwException) throws HiveException {
    String[] names = Utilities.getDbTableName(tabName);
    final String  tableName = names[1];
    final String  dbName = names[0];
    String tableMetaRef = null;
    if (names.length == 3) {
      tableMetaRef = names[2];
    }
    String fullyQualName = dbName + "." + tableName;
    if (tableMetaRef != null) {
      fullyQualName += "." + tableMetaRef;
    }
    if (!tabNameToTabObject.containsKey(fullyQualName)) {
      Table table = db.getTable(dbName, tableName, tableMetaRef, throwException, false, false);
      if (table != null) {
        tabNameToTabObject.put(fullyQualName, table);
      }
      return table;
    }
    return tabNameToTabObject.get(fullyQualName);
  }
NOTE: there can only be one select caluse since we don't handle multi destination insert.
@param isAllColRefRewrite
         when it is true, it means that it is called from group by *, where we use
         genSelectLogicalPlan to rewrite *
@return RelNode: the select relnode RowResolver: i.e., originalRR, the RR after select when there is an order by.
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java