Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/16098
  
    Ah, @marmbrus thanks for pointing that out. I see close should be 
idempotent by design but I am worried if it is guaranteed that they actually 
are. I mean.. for example, `ParquetRecordWriter`'s `close()` is not idempotent 
up to my understanding because at least it'd throw `NullPointerException` 
currently when we try to close multiple times.
    
    For example, If we close this via 
[ParquetRecordWriter.close()](https://github.com/apache/parquet-mr/blob/apache-parquet-1.8.0/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetRecordWriter.java#L110-L116)
 which calls [InternalParquetRecordWriter. 
flushRowGroupToStore()](https://github.com/apache/parquet-mr/blob/apache-parquet-1.8.0/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordWriter.java#L155-L175)
  through 
[InternalParquetRecordWriter.close()](https://github.com/apache/parquet-mr/blob/apache-parquet-1.8.0/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/InternalParquetRecordWriter.java#L113),
 it would throws at least `NullPointerException` as the column store 
(containing column writers) becomes `null` for the first close().
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to