You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Lefty Leverenz <le...@gmail.com> on 2016/04/05 02:24:51 UTC

Re: Hive Macros roadmap

Shannon Ladymon has documented Hive macros in the wiki
<https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Create/DropMacro>,
using examples from HIVE-2655
<https://issues.apache.org/jira/browse/HIVE-2655> and HIVE-13372
<https://issues.apache.org/jira/browse/HIVE-13372>.  Review comments,
corrections, and additions are welcome.

Thanks, Shannon!

-- Lefty

On Sun, Sep 13, 2015 at 10:53 PM, Lefty Leverenz <le...@gmail.com>
wrote:

> HIVE-2655 <https://issues.apache.org/jira/browse/HIVE-2655> added macros
> in release 0.12.0, so I've added a TODOC12 label and doc note to it.
>
> Thank you Elliot for drawing this to our attention.
>
> -- Lefty
>
>
> On Fri, Sep 11, 2015 at 3:41 PM, Edward Capriolo <ed...@gmail.com>
> wrote:
>
>> Macro's are in and tested. No one will remove them. The unit tests ensure
>> they keep working.
>>
>> On Fri, Sep 11, 2015 at 3:38 PM, Elliot West <te...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I noticed some time ago the Hive Macro feature. To me at least this
>>> seemed like an excellent addition to HQL, allowing the user to encapsulate
>>> complex column logic as an independent HQL, reusable macro while avoiding
>>> the complexities of Java UDFs. However, few people seem to be aware of them
>>> or use them. If you are unfamiliar with macros they look like this:
>>>
>>> hive> create temporary macro MYSIGMOID(x DOUBLE)
>>>     > 2.0 / (1.0 + exp(-x));
>>> OK
>>>
>>> hive> select MYSIGMOID(1.0) from dual;
>>> OK
>>>
>>> 1.4621171572600098
>>>
>>>
>>> As far as I can tell, they are no longer documented on the Hive wiki.
>>> There is a tiny reference to them in the O'Reilly 'Programming Hive' book
>>> (page 185). Can anyone advise me on the following:
>>>
>>>    - Are there are plans to keep or remove this functionality?
>>>    - Are there are plans to document this functionality?
>>>    - Aside from limitations of HQL are there compelling reasons not to
>>>    use macros?
>>>
>>> Thanks - Elliot.
>>>
>>>
>>
>