Remove duplicate method in RecordFileWriter
@@ -21,10 +21,8 @@ import com.facebook.presto.spi.block.Block;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.spi.type.TypeManager;
import com.google.common.base.Splitter;
-import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import io.airlift.units.DataSize;
-import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter;
import org.apache.hadoop.hive.serde2.SerDeException;
@@ -46,6 +44,7 @@ import static com.facebook.presto.hive.HiveType.toHiveTypes;
import static com.facebook.presto.hive.HiveWriteUtils.createFieldSetter;
import static com.facebook.presto.hive.HiveWriteUtils.createRecordWriter;
import static com.facebook.presto.hive.HiveWriteUtils.getRowColumnInspectors;
+import static com.facebook.presto.hive.HiveWriteUtils.initializeSerializer;
import static com.google.common.base.MoreObjects.toStringHelper;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
@@ -175,19 +174,6 @@ public class RecordFileWriter
}
}
- @SuppressWarnings("deprecation")
- private static Serializer initializeSerializer(Configuration conf, Properties properties, String serializerName)
- {
- try {
- Serializer result = (Serializer) Class.forName(serializerName).getConstructor().newInstance();
- result.initialize(conf, properties);
- return result;
- }
- catch (SerDeException | ReflectiveOperationException e) {
- throw Throwables.propagate(e);
- }
- }
-
@Override
public String toString()
{
