You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/11/26 23:41:00 UTC

[jira] [Work logged] (HIVE-25741) HiveProtoLoggingHook EventLogger should always close old writer

     [ https://issues.apache.org/jira/browse/HIVE-25741?focusedWorklogId=686946&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-686946 ]

ASF GitHub Bot logged work on HIVE-25741:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Nov/21 23:40
            Start Date: 26/Nov/21 23:40
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2819:
URL: https://github.com/apache/hive/pull/2819#discussion_r757717860



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java
##########
@@ -314,6 +314,7 @@ private void writeEvent(HiveHookEventProtoPartialBuilder builder) {
         try {
           if (eventPerFile) {
             if (!maybeRolloverWriterForDay()) {
+              IOUtils.closeQuietly(writer);

Review comment:
       Why not just call `maybeRolloverWriterForDay()`. That method makes sure that the writer is open and ready?
   Same way as for the normal case.
   Like:
   ```
   maybeRolloverWriterForDay();
   LOG.debug("Event per file enabled. New proto event file: {}", writer.getPath());
   writer.writeProto(event);
   IOUtils.closeQuietly(writer);
   writer = null;
   ```
   




-- 
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: gitbox-unsubscribe@hive.apache.org

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


Issue Time Tracking
-------------------

            Worklog Id:     (was: 686946)
    Remaining Estimate: 0h
            Time Spent: 10m

> HiveProtoLoggingHook EventLogger should always close old writer
> ---------------------------------------------------------------
>
>                 Key: HIVE-25741
>                 URL: https://issues.apache.org/jira/browse/HIVE-25741
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Marton Bod
>            Assignee: Marton Bod
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> If {{hive.hook.proto.file.per.event=true}} (recommended for S3A filesystem), the Hive proto {{EventLogger}} will create a new file for each proto event. However, if we already had an appropriate writer (i.e. maybeRolloverWriterForDay() returns false) from some previous operation - we don't close the previous writer instance before creating a new one.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)