code: private static Deserializer getDeserializer(HiveRegistrationUnit unit) {
      Optional<String> serdeClass = unit.getSerDeType();
      if (!serdeClass.isPresent()) {
        return null;
      }
  
      String serde = serdeClass.get();
      HiveConf hiveConf;
      Deserializer deserializer;
      try {
        hiveConf = SharedResourcesBrokerFactory
          .getImplicitBroker().getSharedResource(new HiveConfFactory<>(), SharedHiveConfKey.INSTANCE);
        deserializer =
            ReflectionUtils.newInstance(hiveConf.getClassByName(serde).asSubclass(Deserializer.class), hiveConf);
      } catch (ClassNotFoundException e) {
        LOG.warn("Serde class " + serde + " not found!", e);
        return null;
      } catch (NotConfiguredException nce) {
        LOG.error("Implicit broker is not configured properly", nce);
        return null;
      }
  
      Properties props = new Properties();
      props.putAll(unit.getProps().getProperties());
      props.putAll(unit.getStorageProps().getProperties());
      props.putAll(unit.getSerDeProps().getProperties());
  
      try {
        SerDeUtils.initializeSerDe(deserializer, hiveConf, props, null);
  
        // Temporary check that's needed until Gobblin is upgraded to Hive 1.1.0+, which includes the improved error
        // handling in AvroSerDe added in HIVE-7868.
        if (deserializer instanceof AvroSerDe) {
          try {
            inVokeDetermineSchemaOrThrowExceptionMethod(props, new Configuration());
          } catch (SchemaParseException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
            LOG.warn("Failed to initialize AvroSerDe.");
            throw new SerDeException(e);
          }
        }
      } catch (SerDeException e) {
        LOG.warn("Failed to initialize serde " + serde + " with properties " + props + " for table " + unit.getDbName() +
            "." + unit.getTableName());
        return null;
      }
  
      return deserializer;
    }
docs: Returns a Deserializer from HiveRegistrationUnit if present and successfully initialized. Else returns null.