}
public EsHiveRecordWriter getHiveRecordWriter(JobConf jc, Path finalOutPath, Class valueClass, boolean isCompressed, Properties tableProperties, Progressable progress) {
// force the table properties to be merged into the configuration
// NB: the properties are also available in HiveConstants#OUTPUT_TBL_PROPERTIES
Settings settings = HadoopSettingsManager.loadFrom(jc).merge(tableProperties);
Log log = LogFactory.getLog(getClass());
// NB: ESSerDe is already initialized at this stage but should still have a reference to the same cfg object
// NB: the value writer is not needed by Hive but it's set for consistency and debugging purposes
InitializationUtils.setValueWriterIfNotSet(settings, HiveValueWriter.class, log);
InitializationUtils.setBytesConverterIfNeeded(settings, HiveBytesConverter.class, log);
// set write resource
settings.setResourceWrite(settings.getResourceWrite());
HiveUtils.init(settings, log);
return new EsHiveRecordWriter(jc, progress);
}