public static HCatWriter getHCatWriter(final WriterContext cntxt,
                       final StateProvider sp) {
    // In future, this may examine context to return appropriate HCatWriter
    return new HCatOutputFormatWriter(cntxt, sp);
  }
This should be called at slave nodes to obtain an instance of
{@link HCatWriter}. If an external system has some mechanism for providing
state to HCatalog, this constructor can be used.

@param cntxt
         {@link WriterContext} obtained at master node
@param sp
         {@link StateProvider}
@return {@link HCatWriter}
hcatalog/core/src/main/java/org/apache/hive/hcatalog/data/transfer/DataTransferFactory.java