Description
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.
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] | +----------------------------------------------------+
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 | | +------------+-------+-----------------+------------------------------+-------------------+-----------------+
From the above mysql table, IS_IN_UNMANAGED is not set and 'show resource plan global' is not showing triggers defined in unmanaged pool.