public static HCatSchema getTableSchema(Configuration conf)
    throws IOException {
    InputJobInfo inputJobInfo = getJobInfo(conf);
    HCatSchema allCols = new HCatSchema(new LinkedList<HCatFieldSchema>());
    for (HCatFieldSchema field :
      inputJobInfo.getTableInfo().getDataColumns().getFields()) {
      allCols.append(field);
    }
    for (HCatFieldSchema field :
      inputJobInfo.getTableInfo().getPartitionColumns().getFields()) {
      allCols.append(field);
    }
    return allCols;
  }
Gets the HCatTable schema for the table specified in the HCatInputFormat.setInput call
on the specified job context. This information is available only after HCatInputFormat.setInput
has been called for a JobContext.
@param conf the Configuration object
@return the table schema
@throws IOException if HCatInputFormat.setInput has not been called
                    for the current context
hcatalog/core/src/main/java/org/apache/hive/hcatalog/mapreduce/HCatBaseInputFormat.java