You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/04/07 11:54:05 UTC

[GitHub] [hudi] xiaozhch5 commented on a diff in pull request #5251: Fix hadoop 3 compile Error, use FSDataOutputStream(OutputStream out, FileSystem.Statistics stats) instead of FSDataOutputStream(OutputStream out)

xiaozhch5 commented on code in PR #5251:
URL: https://github.com/apache/hudi/pull/5251#discussion_r845044294


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieParquetDataBlock.java:
##########
@@ -109,7 +109,7 @@ public HoodieLogBlockType getBlockType() {
 
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-    try (FSDataOutputStream outputStream = new FSDataOutputStream(baos)) {
+    try (FSDataOutputStream outputStream = new FSDataOutputStream(baos, null)) {
       try (HoodieParquetStreamWriter<IndexedRecord> parquetWriter = new HoodieParquetStreamWriter<>(outputStream, avroParquetConfig)) {

Review Comment:
   Yes, hadoop2 has three constructors, just like below.
   
   ```java
     @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.
   
   ```java
     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;
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org