public static Deserializer getDeserializer(Configuration conf, org.apache.hadoop.hive.metastore.api.Table table,
      String metaTable, boolean skipConfError, String lib) throws MetaException {
    AbstractSerDe deserializer;
    try {
      deserializer = ReflectionUtil.newInstance(conf.getClassByName(lib).asSubclass(AbstractSerDe.class), conf);
    } catch (Exception e) {
      throw new MetaException(e.getClass().getName() + " " + e.getMessage());
    }

    try {
      Properties properties = MetaStoreUtils.getTableMetadata(table);
      if (metaTable != null) {
        properties.put("metaTable", metaTable);
      }
      deserializer.initialize(conf, properties, null);
    } catch (SerDeException e) {
      if (!skipConfError) {
        LOG.error("error in initSerDe: " + e.getClass().getName() + " " + e.getMessage(), e);
        throw new MetaException(e.getClass().getName() + " " + e.getMessage());
      }
    }
    return deserializer;
  }
getDeserializer

Get the Deserializer for a table.

@param conf
         - hadoop config
@param table
         the table
@return
  Returns instantiated deserializer by looking up class name of deserializer stored in
  storage descriptor of passed in table. Also, initializes the deserializer with schema
  of table.
@exception MetaException
             if any problems instantiating the Deserializer

             todo - this should move somewhere into serde.jar
metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreUtils.java