hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elliot West <tea...@gmail.com>
Subject Re: Unit testing macros
Date Fri, 30 Sep 2016 09:45:40 GMT
Hi,

You can achieve this by storing the macro definition in a separate HQL file
and 'import' this as needed. Unfortunately such imports are interpreted by
your Hive client and the relevant command varies between client
implementations: '!run' in Beeline and 'SOURCE' in Hive CLI. I raised a
proposal to create a unified command that is compatible across clients but
this has yet to gain any traction:
https://issues.apache.org/jira/browse/HIVE-12703

Elliot.


On 30 September 2016 at 10:23, Sta┼ćislavs Rogozins <
stanislavs.rogozins@gmail.com> wrote:

> The Unit testing wiki page
> <https://cwiki.apache.org/confluence/display/Hive/Unit+Testing+Hive+SQL> suggests
> using macros to 'extract and resuse the expressions applied to columns' and
> that they can be 'readily isolated for testing'. However as far as I'm
> aware, right now only temporary macros can be created, that stop existing
> outside of session where they were defined(https://cwiki.apache.
> org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Create/
> DropMacro), thus making it necessary to include the macro in every HQL
> script that uses it. How is it possible to isolate them for testing?
>

Mime
View raw message