arina-ielchiieva commented on a change in pull request #1873: DRILL-6096: 
Provide mechanism to configure text writer configuration
URL: https://github.com/apache/drill/pull/1873#discussion_r336918266
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/easy/text/writer/TextRecordWriter.java
 ##########
 @@ -165,10 +182,12 @@ public void writeField() throws IOException {
   @Override
   public void cleanup() throws IOException {
     super.cleanup();
-    if (stream != null) {
-      stream.close();
-      stream = null;
-      logger.debug("closing file");
+
+    fRecordStarted = false;
+    if (writer != null) {
+      writer.close();
 
 Review comment:
   Good point, will update the code. Catched `IllegalStateException` since 
`writer.close()` can throw only this expiation and wrapped it into 
`IOException` since `WriterRecordBatch#closeWriter` method handles properly 
this type of exception.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to