There are multiple ways of doing it. It will depend on your method of implementation as well. i.e. what is the platform you are using to fire the hive queries.
Pig can do that for you (as already confirmed by another user) Shell scripts (unix based implementation) also supports it. A very crude yet effective way : hive -e 'select *from table' > /home/user/output$$.txt You may want to check out the Hive CLI features available and then pick what suits your need best: 1. https://cwiki.apache.org/confluence/display/Hive/LanguageManual+VariableSubstitution 2. primer: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli Hope this helps you to move forward regards Dev On Fri, Dec 4, 2015 at 5:48 AM, mahender bigdata < mahender.bigd...@outlook.com> wrote: > Hi, > Is there option available to store hive results into variable like > > select @i= count(*) from HiveTable. > > or > > Storing Table Results into variable and make use of it later stage of > Query. I tired using HQL CTE but the scope of CTE is limited to next select > only, Is there a way to intermediate results like join data into variable > and make use of it latter stage. > > Thanks, > Mahender > -- Devopam Mittra Life and Relations are not binary