hive-user mailing list archives

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

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:


On 30 September 2016 at 10:23, Sta┼ćislavs Rogozins <> wrote:

> The Unit testing wiki page
> <> 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?

View raw message