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

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

                Author: ASF GitHub Bot
            Created on: 01/Dec/20 20:53
            Start Date: 01/Dec/20 20:53
    Worklog Time Spent: 10m 
      Work Description: miklosgergely commented on a change in pull request 
#1725:
URL: https://github.com/apache/hive/pull/1725#discussion_r533714117



##########
File path: 
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
##########
@@ -1217,7 +1251,7 @@ private void addNotificationLog(NotificationEvent event, 
ListenerEvent listenerE
         params.add(catName);
       }
 
-      s = "insert into \"NOTIFICATION_LOG\" (" + columns + ") VALUES (" + 
insertVal + ")";
+      String s = "insert into \"NOTIFICATION_LOG\" (" + columns + ") VALUES (" 
+ insertVal + ")";

Review comment:
       The very most of this query is constant, so I'd create a constant for it 
like this:
   insert into \"NOTIFICATION_LOG\" (\"NL_ID\", \"EVENT_ID\", 
...\"MESSAGE_FORMAT\"%s) VALUES (?, ... ?%s) then replace only the two %s 
placeholders with the potential cat, db, table name, and their ? characters. 
This would simplify the code a lot.




----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 518655)
    Time Spent: 20m  (was: 10m)

> Refactor Get Next Event ID for DbNotificationListener
> -----------------------------------------------------
>
>                 Key: HIVE-24460
>                 URL: https://issues.apache.org/jira/browse/HIVE-24460
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Refactor event ID generation to match notification log ID generation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to