Skip to content

Conversation

@xiaozhch5
Copy link
Contributor

@xiaozhch5 xiaozhch5 commented Apr 7, 2022

Tips

What is the purpose of the pull request

Fix hadoop 3 compile error.

Compile hudi with hadoop3, there arouse the following errors:

微信图片_20220407194206

The reason is that, Hadoop3 delete FSDataOutputStream(OutputStream out) constructor of FSDataOutputStream

Brief change log

use FSDataOutputStream(OutputStream out, FileSystem.Statistics stats) instead of FSDataOutputStream(OutputStream out) in HoodieParquetDataBlock

Verify this pull request

This pull request is a trivial rework / code cleanup without any test coverage.

Committer checklist

  • Commit message is descriptive of the change

…tream out) is deleted in hadoop 3, use FSDataOutputStream(OutputStream out, FileSystem.Statistics stats) instead.

try (FSDataOutputStream outputStream = new FSDataOutputStream(baos)) {
try (FSDataOutputStream outputStream = new FSDataOutputStream(baos, null)) {
try (HoodieParquetStreamWriter<IndexedRecord> parquetWriter = new HoodieParquetStreamWriter<>(outputStream, avroParquetConfig)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does hadoop 2 has this method ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, hadoop2 has three constructors, just like below.

  @Deprecated
  public FSDataOutputStream(OutputStream out) throws IOException {
    this(out, null);
  }

  public FSDataOutputStream(OutputStream out, FileSystem.Statistics stats)
    throws IOException {
    this(out, stats, 0);
  }

  public FSDataOutputStream(OutputStream out, FileSystem.Statistics stats,
                            long startPosition) throws IOException {
    super(new PositionCache(out, stats, startPosition));
    wrappedStream = out;
  }

But hadoop3 delete the constructor of FSDataOutputStream(OutputStream out), the rest constructors is like below.

  public FSDataOutputStream(OutputStream out, FileSystem.Statistics stats) {
    this(out, stats, 0);
  }

  public FSDataOutputStream(OutputStream out, FileSystem.Statistics stats,
                            long startPosition) {
    super(new PositionCache(out, stats, startPosition));
    wrappedStream = out;
  }

@hudi-bot
Copy link
Collaborator

hudi-bot commented Apr 7, 2022

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@yihua
Copy link
Contributor

yihua commented Apr 8, 2022

This change has already been covered by #4286 which is going to be ready for review soon. I'm wondering if it still makes sense to have this PR independently.

@xiaozhch5
Copy link
Contributor Author

Sorry, I didn't nitice that PR, this PR can be closed.

@xiaozhch5 xiaozhch5 closed this Apr 8, 2022
@yihua
Copy link
Contributor

yihua commented Apr 9, 2022

Sorry, I didn't nitice that PR, this PR can be closed.

No worries. Feel free to chime in on that PR regarding the concern @danny0405 has put up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants