What is a "leaf expression"?

by davidjhp   Last Updated January 18, 2018 19:06 PM

What is a "leaf expression"?

Partition-clause expressions are limited in the following ways:


  • You can specify leaf expressions, functions, and operators in the partition clause expression.
  • All leaf expressions in the partition clause must be either constants or columns of the table.

Source https://my.vertica.com/docs/6.1.x/HTML/index.htm#18125.htm

Answers 2

I'm pretty sure leaf expression means something like "a?b:c". A discrete value from a conditional.

But basically the overall message is saying you need to avoid null values. They can't partition on a null.

September 04, 2013 14:51 PM

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.

That same page also has,

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.

So it's my guess that it's something about the input to the HASH function,

All leaf expressions must be constants or column references to a column in the CREATE PROJECTION's SELECT list.

So essentially a hash can work over a non-aggregate functions, operators, constants or columns?

Not sure if any of this is correct.

Evan Carroll
Evan Carroll
January 18, 2018 18:59 PM

Related Questions

How to get Size of db tables one month back

Updated February 23, 2017 07:06 AM

Vertica grant user create table

Updated April 13, 2017 17:06 PM

Vertica-cluster architecture

Updated September 13, 2017 08:06 AM