hadoop-hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zheng Shao (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HIVE-164) Support CASE and IF statement
Date Sat, 13 Dec 2008 01:36:44 GMT

    [ https://issues.apache.org/jira/browse/HIVE-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656226#action_12656226

Zheng Shao commented on HIVE-164:

By UDFTemplate, I was refering to the execution part of IF/CASE. IF/CASE/COALESCE can all
be considered as UDF except that the type of the arguments can be anything (instead of just
PrimitiveTypes like int, string, etc).

In Hive execution code, every object is represented using a pair (o: Object, oi: ObjectInspector).
The oi contains information about the type of the object and also how to access the fields/elements
inside the object (in case it's a struct/list/map).  The interface is exprNodeExprEvaluator.java.

For the grammar part, I think we can support all 3: IF, CASE, COALESCE.

> Support CASE and IF statement
> -----------------------------
>                 Key: HIVE-164
>                 URL: https://issues.apache.org/jira/browse/HIVE-164
>             Project: Hadoop Hive
>          Issue Type: New Feature
>          Components: Query Processor
>            Reporter: Zheng Shao
>            Assignee: David Phillips
> See http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html for details.
> Syntax:
> {code}
> CASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN result ...] [<ELSE
result] END
> CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END

> IF(expr1,expr2,expr3)
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message