Wechar created HIVE-29312:
-----------------------------

             Summary: Concatenate equality conditions in AND nodes
                 Key: HIVE-29312
                 URL: https://issues.apache.org/jira/browse/HIVE-29312
             Project: Hive
          Issue Type: Improvement
          Components: Standalone Metastore
    Affects Versions: 4.1.0
            Reporter: Wechar
            Assignee: Wechar


Current partition filtert tree is a binary tree with single condition in the 
leaf node, actually the adjacent AND leaf nodes can be combined together to 
match longer index prefix. For example, a table has partition key: a, b, c, d, 
and a filter is {{a=1 and b=1 and c=1}}, when visit as a binary tree 
*AND(AND(a=1, b=1), c=1)*,  the filter is:
{code:sql}
PART_NAME like 'a=1/%' and PART_NAME like '%/b=2/%' and PART_NAME like '%/c=3/%'
{code}
If we combine the adjacent AND conditions, the tree will be *MultiAnd(a=1, b=2, 
c=3)*, aand the filte can be:
{code:bash}
PART_NAME like 'a=1/b=2/c=3/%'
{code}

Obviously, the latter could match a longer index prefix and is more efficient.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to