You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Bharathkrishna Guruvayoor Murali (JIRA)" <ji...@apache.org> on 2018/10/05 23:27:00 UTC

[jira] [Comment Edited] (HIVE-13157) MetaStoreEventListener.onAlter triggered for INSERT and SELECT

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

Bharathkrishna Guruvayoor Murali edited comment on HIVE-13157 at 10/5/18 11:26 PM:
-----------------------------------------------------------------------------------

I have observed that 2 alter notifications are created for insert, while only one is actually needed (still present in master  4.0).
Basically my understanding is that the loadTable in Hive.java : [Hive.java#L2630|https://github.com/apache/hive/blob/a4b087b18bd5b0b4023bced68c85cf1e16301fed/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java#L2630] calls alterTable even when there is a stats change, and only change happening is transient_lastDdl because actual alter of stats happens in the next alter_table event that follows this.

I wanted to change the code in the following way :
{code:java}
  if (hasFollowingStatsTask) {
      environmentContext = new EnvironmentContext();
      environmentContext.putToProperties(StatsSetupConst.DO_NOT_UPDATE_STATS, StatsSetupConst.TRUE);
    }
else {
    alterTable(tbl, false, environmentContext, true);
}
{code}
Change above is adding alterTable in else part, ie. when there is no stat task to follow. But I do not know if loadTable is used in a different code path where this alterTable is useful irrespective of stat change.

 

+ [~sershe] [~vihangk1] [~akolb] [~pvary] What do you think about this, can you think of any case where the alterTable should not be in the else part.


was (Author: bharos92):
This is still present in master. I was looking into the same issue, basically my understanding is that the loadTable in Hive.java : [Hive.java#L2630|https://github.com/apache/hive/blob/a4b087b18bd5b0b4023bced68c85cf1e16301fed/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java#L2630] calls alterTable even when there is a stats change, and only change happening is transient_lastDdl because actual alter of stats happens in the next alter_table event that follows this.

I wanted to change the code in the following way :
{code:java}
  if (hasFollowingStatsTask) {
      environmentContext = new EnvironmentContext();
      environmentContext.putToProperties(StatsSetupConst.DO_NOT_UPDATE_STATS, StatsSetupConst.TRUE);
    }
else {
    alterTable(tbl, false, environmentContext, true);
}
{code}
Change above is adding alterTable in else part, ie. when there is no stat task to follow. But I do not know if loadTable is used in a different code path where this alterTable is useful irrespective of stat change.

 

+ [~sershe] [~vihangk1] [~akolb] [~pvary] What do you think about this, can you think of any case where the alterTable should not be in the else part.

> MetaStoreEventListener.onAlter triggered for INSERT and SELECT
> --------------------------------------------------------------
>
>                 Key: HIVE-13157
>                 URL: https://issues.apache.org/jira/browse/HIVE-13157
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 1.2.1, 4.0.0
>            Reporter: Eugen Stoianovici
>            Assignee: Bharathkrishna Guruvayoor Murali
>            Priority: Critical
>
> The event onAlter from org.apache.hadoop.hive.metastore.MetaStoreEventListener is triggered when INSERT or SELECT statements are executed on the target table.
> Furthermore, the value of transient_lastDdl is updated in table properties for INSERT statements.



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