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

Prasanth Jayachandran commented on HIVE-18457:
----------------------------------------------

For debugging, pasting the state of metastore tables here
{code}
mysql> select * from wm_resourceplan;
+-------+--------+-------------------+---------+-----------------+
| RP_ID | NAME   | QUERY_PARALLELISM | STATUS  | DEFAULT_POOL_ID |
+-------+--------+-------------------+---------+-----------------+
|     1 | global |              NULL | ACTIVE  |               1 |
|     2 | llap   |              NULL | ENABLED |               2 |
+-------+--------+-------------------+---------+-----------------+
2 rows in set (0.00 sec)

mysql> select * from wm_pool;
+---------+-------+---------+----------------+-------------------+-------------------+
| POOL_ID | RP_ID | PATH    | ALLOC_FRACTION | QUERY_PARALLELISM | 
SCHEDULING_POLICY |
+---------+-------+---------+----------------+-------------------+-------------------+
|       1 |     1 | default |              1 |                 4 | NULL         
     |
|       2 |     2 | default |              1 |                 4 | NULL         
     |
+---------+-------+---------+----------------+-------------------+-------------------+
2 rows in set (0.01 sec)

mysql> select * from wm_pool_to_trigger;
Empty set (0.01 sec)

mysql> select * from wm_mapping;
Empty set (0.00 sec)

mysql> select * from wm_trigger;
+------------+-------+-----------------+------------------------------+-------------------+-----------------+
| TRIGGER_ID | RP_ID | NAME            | TRIGGER_EXPRESSION           | 
ACTION_EXPRESSION | IS_IN_UNMANAGED |
+------------+-------+-----------------+------------------------------+-------------------+-----------------+
|         29 |     1 | highly_parallel | TOTAL_TASKS > 40             | KILL    
          |                |
|         33 |     1 | big_hdfs_read   | HDFS_BYTES_READ > 3000000000 | KILL    
          |                |
|         34 |     1 | slow_query      | EXECUTION_TIME > 100000      | KILL    
          |                |
|         35 |     1 | some_spills     | SPILLED_RECORDS > 10         | KILL    
          |                |
+------------+-------+-----------------+------------------------------+-------------------+-----------------+
4 rows in set (0.00 sec)
{code}


> Triggers in unmanaged pools are not shown
> -----------------------------------------
>
>                 Key: HIVE-18457
>                 URL: https://issues.apache.org/jira/browse/HIVE-18457
>             Project: Hive
>          Issue Type: Sub-task
>    Affects Versions: 3.0.0
>            Reporter: Prasanth Jayachandran
>            Assignee: Sergey Shelukhin
>            Priority: Major
>
> Did the following sequence to add triggers to UNMANAGED. I can see the 
> triggers added to metastore by IS_IN_UNAMANGED flag is not set in metastore. 
> Also show resource plans does not show triggers in unmanaged pool.
> {code}
> 0: jdbc:hive2://localhost:10000> show resource plans;
> +----------+----------+--------------------+
> | rp_name  |  status  | query_parallelism  |
> +----------+----------+--------------------+
> | global   | ACTIVE   | NULL               |
> | llap     | ENABLED  | NULL               |
> +----------+----------+--------------------+
> 0: jdbc:hive2://localhost:10000>ALTER RESOURCE PLAN llap ACTIVATE;
> 0: jdbc:hive2://localhost:10000>ALTER RESOURCE PLAN global DISABLE;
> 0: jdbc:hive2://localhost:10000>CREATE TRIGGER global.highly_parallel WHEN 
> TOTAL_TASKS > 40 DO KILL;
> 0: jdbc:hive2://localhost:10000>ALTER TRIGGER global.highly_parallel ADD TO 
> UNMANAGED;
> 0: jdbc:hive2://localhost:10000>CREATE TRIGGER global.big_hdfs_read WHEN 
> HDFS_BYTES_READ > 3000000000 DO KILL;
> 0: jdbc:hive2://localhost:10000>ALTER TRIGGER global.big_hdfs_read ADD TO 
> UNMANAGED;
> 0: jdbc:hive2://localhost:10000>CREATE TRIGGER global.slow_query WHEN 
> EXECUTION_TIME > 100000 DO KILL;
> 0: jdbc:hive2://localhost:10000>ALTER TRIGGER global.slow_query ADD TO 
> UNMANAGED;
> 0: jdbc:hive2://localhost:10000>CREATE TRIGGER global.some_spills WHEN 
> SPILLED_RECORDS > 10 DO KILL;
> 0: jdbc:hive2://localhost:10000>ALTER TRIGGER global.some_spills ADD TO 
> UNMANAGED;
> 0: jdbc:hive2://localhost:10000>ALTER RESOURCE PLAN global ENABLE;
> 0: jdbc:hive2://localhost:10000>ALTER RESOURCE PLAN global ACTIVATE;
> 0: jdbc:hive2://localhost:10000> show resource plan global;
> +----------------------------------------------------+
> |                        line                        |
> +----------------------------------------------------+
> | global[status=ACTIVE,parallelism=null,defaultPool=default] |
> |     default[allocFraction=1.0,schedulingPolicy=null,parallelism=4] |
> +----------------------------------------------------+
> {code}
> {code:title=mysql}
> mysql> select * from wm_trigger;
> +------------+-------+-----------------+------------------------------+-------------------+-----------------+
> | TRIGGER_ID | RP_ID | NAME            | TRIGGER_EXPRESSION           | 
> ACTION_EXPRESSION | IS_IN_UNMANAGED |
> +------------+-------+-----------------+------------------------------+-------------------+-----------------+
> |         29 |     1 | highly_parallel | TOTAL_TASKS > 40             | KILL  
>             |                |
> |         33 |     1 | big_hdfs_read   | HDFS_BYTES_READ > 3000000000 | KILL  
>             |                |
> |         34 |     1 | slow_query      | EXECUTION_TIME > 100000      | KILL  
>             |                |
> |         35 |     1 | some_spills     | SPILLED_RECORDS > 10         | KILL  
>             |                |
> +------------+-------+-----------------+------------------------------+-------------------+-----------------+
> {code}
> From the above mysql table, IS_IN_UNMANAGED is not set and 'show resource 
> plan global' is not showing triggers defined in unmanaged pool. 



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

Reply via email to