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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]