apache / parquet-java

Apache Parquet Java
https://parquet.apache.org/
Apache License 2.0
2.65k stars 1.41k forks source link

MINOR: ParquetRewriter must close opened reader/stream #3002

Closed cetindogu closed 2 months ago

cetindogu commented 2 months ago

if reader not closed, open parquet files in cannot be deleted.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

cetindogu commented 2 months ago

anything you want me to do ? i dont know why pipeline fails !!!

wgtmac commented 2 months ago
Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/parquet-java/parquet-java/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/rewrite/ParquetRewriter.java:[256,19] unreported exception java.io.IOException; must be caught or declared to be thrown

Calling close() may throw IOException.

cetindogu commented 2 months ago

i got it. i will solve (tomorrow date hour) thanks. it is my fault, i edited from github webpage editor:)

cetindogu commented 2 months ago

fix: close() can throw IOException initNextReader() method has 2 usages and both of them already throws IOException so this must solve the problem

usage 1 -> public ParquetRewriter(RewriteOptions options) throws IOException usage 2 -> public void processBlocks() throws IOException

image

cetindogu commented 2 months ago
Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/parquet-java/parquet-java/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/rewrite/ParquetRewriter.java:[256,19] unreported exception java.io.IOException; must be caught or declared to be thrown

Calling close() may throw IOException.

thanks for your fast answer i can't use intellij in windows 11 for this project. it cant be compiled. so i updated the code with text editor.

cetindogu commented 2 months ago

Is it indentation and white Space problem?

cetindogu commented 2 months ago

i combined "reader.close();" command with "if" clouse (one line)

cetindogu commented 2 months ago

fix: white space is added after if if(reader != null) reader.close(); to if (reader != null) reader.close();

cetindogu commented 2 months ago

fix: mvn spotless:apply command is run.

cetindogu commented 2 months ago

Anything else that i should do?

@Fokko @wgtmac

wgtmac commented 2 months ago

I just merged it. Thanks @cetindogu and @Fokko!

cetindogu commented 2 months ago

When can i see the new package in maven repo?

wgtmac commented 2 months ago

We will not see it until the next release, e.g. 1.15.0.