sankarh commented on a change in pull request #1237:
URL: https://github.com/apache/hive/pull/1237#discussion_r494034968
##########
File path:
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java
##########
@@ -703,6 +709,49 @@ public void
onAddNotNullConstraint(AddNotNullConstraintEvent addNotNullConstrain
}
}
+ /***
+ * @param addDefaultConstraintEvent add default constraint event
+ * @throws MetaException
+ */
+ @Override
+ public void onAddDefaultConstraint(AddDefaultConstraintEvent
addDefaultConstraintEvent) throws MetaException {
+ List<SQLDefaultConstraint> cols =
addDefaultConstraintEvent.getDefaultConstraintCols();
+ if (cols.size() > 0) {
+ AddDefaultConstraintMessage msg = MessageBuilder.getInstance()
+
.buildAddDefaultConstraintMessage(addDefaultConstraintEvent.getDefaultConstraintCols());
+ NotificationEvent event =
+ new NotificationEvent(0, now(),
EventType.ADD_DEFAULTCONSTRAINT.toString(),
+ msgEncoder.getSerializer().serialize(msg)
+ );
+ event.setCatName(cols.get(0).isSetCatName() ? cols.get(0).getCatName() :
DEFAULT_CATALOG_NAME);
+ event.setDbName(cols.get(0).getTable_db());
+ event.setTableName(cols.get(0).getTable_name());
+ process(event, addDefaultConstraintEvent);
+ }
+ }
+
+ /***
+ * @param addCheckConstraintEvent add check constraint event
+ * @throws MetaException
+ */
+ @Override
+ public void onAddCheckConstraint(AddCheckConstraintEvent
addCheckConstraintEvent) throws MetaException {
+ LOG.info("Inside DBNotification listener for check constraint.");
+ List<SQLCheckConstraint> cols =
addCheckConstraintEvent.getCheckConstraintCols();
+ if (cols.size() > 0) {
+ AddCheckConstraintMessage msg = MessageBuilder.getInstance()
+
.buildAddCheckConstraintMessage(addCheckConstraintEvent.getCheckConstraintCols());
Review comment:
I meant, use cols instead of
addCheckConstraintEvent.getCheckConstraintCols().
----------------------------------------------------------------
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]