Traditionally, leaf and non-leaf refer to nodes in a btree. But, I don't think that has anything to do with the context here.
It's being used in the context of partition statement. The docs for 9.0 are slightly more clear
PARTITION BY expressions can specify leaf expressions, functions, and operators.
In my opinion, leaf expression is a something that can be reduced to a value. The idea of leaf and non-leaf is likely borrowed from procedural programming. Here is an example from a book on Modern X86 Assembly Language Programming: 32-bit, 64-bit, SSE, and AVX
Leaf functions are functions that:
- Do not call any other functions.
- Do not modify the contents of the RSP register.
- Do not allocate any local stack space.
- Do not modify any of the non-volatile general-purpose or XMM registers.
- Do not use exception handling.
- X86-64 assembly language leaf functions are easier to code, but they're only suitable for relatively simple computational tasks.
We can verify that the context of the docs, by taking note of this
It is strongly recommended that you use Vertica's built-in HASH function, which distributes data evenly across the cluster, and facilitates optimal query execution.
In the docs on HASH function, they say,
All leaf expressions must be constants or column references to a column in the
So essentially a hash can work over a non-aggregate functions, operators, or leaf expressions (constants or columns). That means the leaf expression is a subset of functions that are pure (lack side-effects) and are simply folded into a literal.