[ 
https://issues.apache.org/jira/browse/HIVE-16731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Teddy Choi updated HIVE-16731:
------------------------------
    Attachment: HIVE-16731.1.patch

The existing implementation handled only one simple case. It's two of columns 
or non-null constants, such as "CASE WHEN bool1 THEN column1 ELSE value1 END". 
It's easy to translate into an equivalent IF expression, "IF(bool1, column1, 
value1)". So I made it to handle multiple WHEN clauses and an optional ELSE 
clause with a recursive method.

Null values are common in WHEN clauses, but they are excluded in vectorization 
process. So I made IfNullColumn and IfColumnNull classes to support them. It's 
hard to include the classes in VectorizedExpressions annotation in GenericUDFIf 
class, because description treats void as a member of integer family, which is 
already existing one. But it's possible to handle them in 
VectorizedContext.getIfExpression.

> Vectorization: Make "CASE WHEN (day_name='Sunday') THEN column1 ELSE null 
> end" that involves a column name or expression THEN or ELSE vectorize
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-16731
>                 URL: https://issues.apache.org/jira/browse/HIVE-16731
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Matt McCline
>            Assignee: Teddy Choi
>            Priority: Critical
>         Attachments: HIVE-16731.1.patch
>
>
> Currently, CASE WHEN statements like that become VectorUDFAdaptor expressions.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to