apache / apache/parquet-java

honor conf "mapreduce.outputcommitter.factory.class" with PathOutputCommitterFactory in ParquetOutputFormat.getOutputCommitter

Open
#1,685 0 comments 0 reactions 0 assignees View on GitHub
Component: Parquet Priority: Minor Type: bug
Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 12h
Merged PRs (30d)
33

Description

The class ParquetOutputFormat extends org.apache.hadoop.mapreduce.lib.output.FileOutputFormat and override method getOutputCommitter(TaskAttemptContext), but unfortunatly, it replaces by a hard-coded new class instead of configurable factory PathOutputCommitterFactory that use configuration property "mapreduce.outputcommitter.factory.class"

See bugged overriding code :

```java

package org.apache.parquet.hadoop;

import org.apache.hadoop.mapreduce.OutputCommitter;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.PathOutputCommitter;

public class ParquetOutputFormat extends FileOutputFormat {

public synchronized OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException {
if (this.committer == null) {
Path output = getOutputPath(context);
committer = new ParquetOutputCommitter(output, context); // <== BUG: hard coded class, ignore propoerty "mapreduce.outputcommitter.factory.class"
}
return this.committer;
}

```

See overriden code:

```java

package org.apache.hadoop.mapreduce.lib.output;

public abstract class FileOutputFormat extends OutputFormat {

@Override
public OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException {
if (committer == null) {
Path output = getOutputPath(context);
committer = PathOutputCommitterFactory.getCommitterFactory(output, context.getConfiguration()).createOutputCommitter(output, context); // <== OK: configurable factory, accept property "mapreduce.outputcommitter.factory.class"
}
return committer;
}
```

**Reporter**: [Arnaud Nauwynck](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=arnaud.nauwynck)
#### Related issues:
- [performance problem in FileOutputCommitter for big list processed by single thread](https://issues.apache.org/jira/browse/MAPREDUCE-7465) (is related to)
#### PRs and other links:
- [GitHub Pull Request #1243](https://github.com/apache/parquet-mr/pull/1243)
- [GitHub Pull Request #1244](https://github.com/apache/parquet-mr/pull/1244)

**Note**: *This issue was originally created as [PARQUET-2416](https://issues.apache.org/jira/browse/PARQUET-2416). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.