[ 
https://issues.apache.org/jira/browse/HIVE-18942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16397777#comment-16397777
 ] 

Na Li commented on HIVE-18942:
------------------------------

[~kkalyan] The event type is "EventMessage.EventType.ADD_PARTITION", not 
"EventType.ALTER_TABLE". It puts all partitions in the event.
{code:java}
In DbNotificationListener

public void onAddPartition (AddPartitionEvent partitionEvent)
throws MetaException {
Table t = partitionEvent.getTable();
NotificationEvent event = new NotificationEvent(0, now(),
HCatConstants.HCAT_ADD_PARTITION_EVENT,
msgFactory.buildAddPartitionMessage(t, 
partitionEvent.getPartitions()).toString());
event.setDbName(t.getDbName());
event.setTableName(t.getTableName());
enqueue(event, partitionEvent);
}

{code}
 

> ALTER TABLE may generate huge event (with all partitions)
> ---------------------------------------------------------
>
>                 Key: HIVE-18942
>                 URL: https://issues.apache.org/jira/browse/HIVE-18942
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 3.0.0
>            Reporter: Alexander Kolbasov
>            Priority: Major
>
> ALTER TABLE handler in HiveAlterHandler has this code:
> {code:java}
> if (isPartitionedTable) {
>   parts = msdb.getPartitions(newt.getDbName(), newt.getTableName(), -1);
>   MetaStoreListenerNotifier.notifyEvent(transactionalListeners,
>           EventMessage.EventType.ADD_PARTITION,
>           new AddPartitionEvent(newt, parts, true, handler),
>           environmentContext);
> }{code}
> The problem is that table may contain huge number of partitions and the event 
> will contain all of them. Partition object itself isn't very small either, so 
> we may end up with huge events which would be stored and then transmitted 
> over the wire to consumers.
> [~spena] [~kkalyan] [~lina.li] [~vaidyand] FYI.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to