private List<FieldSchema> get_schema_with_environment_context_core(String db, String tableName, final EnvironmentContext envContext)
          throws MetaException, UnknownTableException, UnknownDBException {
    startFunction("get_schema_with_environment_context_core", ": db=" + db + "tbl=" + tableName);
    boolean success = false;
    Exception ex = null;
    try {
      String[] names = tableName.split("\\.");
      String base_table_name = names[0];
      String[] parsedDbName = parseDbName(db, conf);

      Table tbl;
      try {
        tbl = get_table_core(parsedDbName[CAT_NAME], parsedDbName[DB_NAME], base_table_name);
      } catch (NoSuchObjectException e) {
        throw new UnknownTableException(e.getMessage());
      }
      // Pass unparsed db name here
      List<FieldSchema> fieldSchemas = get_fields_with_environment_context_core(db, base_table_name,
              envContext);

      if (tbl == null || fieldSchemas == null) {
        throw new UnknownTableException(tableName + " doesn't exist");
      }

      if (tbl.getPartitionKeys() != null) {
        // Combine the column field schemas and the partition keys to create the
        // whole schema
        fieldSchemas.addAll(tbl.getPartitionKeys());
      }
      success = true;
      return fieldSchemas;
    } catch (Exception e) {
      ex = e;
      throw handleException(e)
              .throwIfInstance(UnknownDBException.class, UnknownTableException.class, MetaException.class)
              .defaultMetaException();
    } finally {
      endFunction("get_schema_with_environment_context_core", success, ex, tableName);
    }
  }
Return the schema of the table. This function includes partition columns
in addition to the regular columns.

@param db
         Name of the database
@param tableName
         Name of the table
@param envContext
         Store session based properties
@return List of columns, each column is a FieldSchema structure
@throws MetaException
@throws UnknownTableException
@throws UnknownDBException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java