Apache Hive workload management commands
Also available as:
PDF

CREATE POOL

You create a query pool in a resource plan that allocates resources for the pool.

CREATE POOL syntax

CREATE POOL plan_name.path WITH ALLOC_FRACTION = decimal, QUERY_PARALLELISM = num, [ SCHEDULING_POLICY = scheduling_value ]
      
  • plan_name.path

    The resource plan name and hierarchy of query pool names, in dot notation

  • decimal

    The proportion, in decimal notation, of the Hive low-latency analytical processing (LLAP) cluster allocated to a pool.

  • num

    The maximum parallel queries allowed in a pool.

  • scheduling_value

    One of 'default'; 'fair', which allocates an equal share of resources on the cluster to each query; or 'fcfs', which allocates all resources to the earliest query. GLOBAL"?>

CREATE POOL example

CREATE POOL myplan.parent WITH ALLOC_FRACTION = 0.5, QUERY_PARALLELISM = 1
CREATE POOL myplan.parent.child1 WITH ALLOC_FRACTION = 0.75, QUERY_PARALLELISM = 2
CREATE POOL myplan.parent.child2 WITH ALLOC_FRACTION = 0.2, QUERY_PARALLELISM = 2
These commands illustrate how allocation fractions of child pools divide the cluster resources and reduce available cluster resources for the overall parent pool:
  • ALLOC_FRACTION of myplan.parent takes 0.5 of the whole cluster.
  • ALLOC_FRACTION of the child1 pool takes 0.75 of the parent pool, which is equivlent to 0.375 of the cluster (0.75 X 0.5 of the cluster, as set in the parent pool allocation fraction).
  • ALLOC_FRACTION of the child2 pool takes 0.2 of the child1 pool, which is equivalent to 0.1 of the cluster (0.2 X 0.5 of the cluster as set in the parent pool allocation fraction).
Consequently, the proportion of cluster resources available to queries in the pool that are not regulated by any nested child pool is 0.025. (0.05 of all queries are not in child pools, multiplied by 0.5 of the entire cluster, as set for the parent pool, equals 0.025.)

CREATE POOL description

Query pools are resource plan rulesets that divide the cluster into different groups of queries. Each pool is allocated a fraction of the LLAP cluster. Optionally, a maximum number of concurrent queries and parallelism in each pool can be set.

You enter query parallelism values as whole numbers. You enter values to allocate resources in query pools is as decimal fractions, because Hive LLAP resource cluster capacity tends to be granular and can frequently shift after small configuration changes. Query parallelism relies on the fixed number of query coordinators, which does not typically change as frequently.

You can nest query pools to divide the rules further into child pools.

In a nested pool, the path part of plan_name.path must include the hierarchy of parent pools, in dot notation.

The CREATE POOL command supports the following properties that represent the rulesets you can apply to control the pool: