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

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

                Author: ASF GitHub Bot
            Created on: 24/Sep/20 04:42
            Start Date: 24/Sep/20 04:42
    Worklog Time Spent: 10m 
      Work Description: 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 
addDefaultConstraintEvent.getDefaultConstraintCols().




----------------------------------------------------------------
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: 489974)
    Time Spent: 2h 10m  (was: 2h)

> NotificationLog should also contain events for default/check constraints
> ------------------------------------------------------------------------
>
>                 Key: HIVE-23618
>                 URL: https://issues.apache.org/jira/browse/HIVE-23618
>             Project: Hive
>          Issue Type: Improvement
>          Components: Standalone Metastore
>    Affects Versions: 4.0.0
>            Reporter: Adesh Kumar Rao
>            Assignee: Adesh Kumar Rao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> This should follow similar approach of notNull/Unique constraints. This will 
> also include event replication for these constraints.



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

Reply via email to