You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Raihan Jamal <ja...@gmail.com> on 2012/07/12 20:31:15 UTC
Output from HiveQL query
I have one question related to the output from the HiveQL query. Suppose I
did some HiveQL query and I will be getting some output back, so those
result set are getting stored somewhere in HDFS? If yes?
1) Then where they are getting stored and how can I access it?**
2) And is there any time limit on that meaning after this much
particular time it will be deleted?**
*Raihan Jamal*
Re: Output from HiveQL query
Posted by Raihan Jamal <ja...@gmail.com>.
That makes sense to me. So that means whenever I do any HiveQL query, only
the output's are displayed on the console, they are not stored anywhere.
And if we want to store, then as Kulkarni suggested we need to do that.
Right?
*Raihan Jamal*
On Thu, Jul 12, 2012 at 12:07 PM, kulkarni.swarnim@gmail.com <
kulkarni.swarnim@gmail.com> wrote:
> Yes.
>
>
> INSERT OVERWRITE DIRECTORY '<PATH>'
>
>
> would mean path on HDFS
>
>
>
> INSERT OVERWRITE LOCAL DIRECTORY '<PATH>'
>
>
> would mean path on the local FS.
>
> On Thu, Jul 12, 2012 at 2:01 PM, Raihan Jamal <ja...@gmail.com>wrote:
>
>> Basically, I was assuming that whenever you do any HiveQL query, all the
>> outputs gets stored somewhere in HDFS, in some path. But from this thread
>> discussion, it means they are not getting stored anywhere in HDFS, but you
>> can specify the path where do you want to store them. Is that right?
>>
>>
>>
>> *Raihan Jamal*
>>
>>
>>
>> On Thu, Jul 12, 2012 at 11:56 AM, Roberto Sanabria <
>> roberto@stumbleupon.com> wrote:
>>
>>> Or you can output to a table and store it there.
>>>
>>>
>>> On Thu, Jul 12, 2012 at 2:53 PM, VanHuy Pham <hu...@gmail.com>wrote:
>>>
>>>> The output can be printed out on terminal when you run it, or can be
>>>> stored if you specify a location for it through the operator >.
>>>> For example:
>>>>
>>>> /home/smith/bin/hive -f "file containing hive sql" >
>>>> /home/smith/documents/output.txt
>>>>
>>>> On Thu, Jul 12, 2012 at 11:31 AM, Raihan Jamal <ja...@gmail.com>wrote:
>>>>
>>>>> I have one question related to the output from the HiveQL query.
>>>>> Suppose I did some HiveQL query and I will be getting some output back, so
>>>>> those result set are getting stored somewhere in HDFS? If yes?
>>>>>
>>>>> 1) Then where they are getting stored and how can I access it?**
>>>>>
>>>>> 2) And is there any time limit on that meaning after this much
>>>>> particular time it will be deleted?**
>>>>>
>>>>>
>>>>> *Raihan Jamal*
>>>>>
>>>>>
>>>>
>>>
>>
>
>
> --
> Swarnim
>
Re: Output from HiveQL query
Posted by "kulkarni.swarnim@gmail.com" <ku...@gmail.com>.
Yes.
INSERT OVERWRITE DIRECTORY '<PATH>'
would mean path on HDFS
INSERT OVERWRITE LOCAL DIRECTORY '<PATH>'
would mean path on the local FS.
On Thu, Jul 12, 2012 at 2:01 PM, Raihan Jamal <ja...@gmail.com> wrote:
> Basically, I was assuming that whenever you do any HiveQL query, all the
> outputs gets stored somewhere in HDFS, in some path. But from this thread
> discussion, it means they are not getting stored anywhere in HDFS, but you
> can specify the path where do you want to store them. Is that right?
>
>
>
> *Raihan Jamal*
>
>
>
> On Thu, Jul 12, 2012 at 11:56 AM, Roberto Sanabria <
> roberto@stumbleupon.com> wrote:
>
>> Or you can output to a table and store it there.
>>
>>
>> On Thu, Jul 12, 2012 at 2:53 PM, VanHuy Pham <hu...@gmail.com>wrote:
>>
>>> The output can be printed out on terminal when you run it, or can be
>>> stored if you specify a location for it through the operator >.
>>> For example:
>>>
>>> /home/smith/bin/hive -f "file containing hive sql" >
>>> /home/smith/documents/output.txt
>>>
>>> On Thu, Jul 12, 2012 at 11:31 AM, Raihan Jamal <ja...@gmail.com>wrote:
>>>
>>>> I have one question related to the output from the HiveQL query.
>>>> Suppose I did some HiveQL query and I will be getting some output back, so
>>>> those result set are getting stored somewhere in HDFS? If yes?
>>>>
>>>> 1) Then where they are getting stored and how can I access it?**
>>>>
>>>> 2) And is there any time limit on that meaning after this much
>>>> particular time it will be deleted?**
>>>>
>>>>
>>>> *Raihan Jamal*
>>>>
>>>>
>>>
>>
>
--
Swarnim
Re: Output from HiveQL query
Posted by Raihan Jamal <ja...@gmail.com>.
Basically, I was assuming that whenever you do any HiveQL query, all the
outputs gets stored somewhere in HDFS, in some path. But from this thread
discussion, it means they are not getting stored anywhere in HDFS, but you
can specify the path where do you want to store them. Is that right?
*Raihan Jamal*
On Thu, Jul 12, 2012 at 11:56 AM, Roberto Sanabria
<ro...@stumbleupon.com>wrote:
> Or you can output to a table and store it there.
>
>
> On Thu, Jul 12, 2012 at 2:53 PM, VanHuy Pham <hu...@gmail.com>wrote:
>
>> The output can be printed out on terminal when you run it, or can be
>> stored if you specify a location for it through the operator >.
>> For example:
>>
>> /home/smith/bin/hive -f "file containing hive sql" >
>> /home/smith/documents/output.txt
>>
>> On Thu, Jul 12, 2012 at 11:31 AM, Raihan Jamal <ja...@gmail.com>wrote:
>>
>>> I have one question related to the output from the HiveQL query. Suppose
>>> I did some HiveQL query and I will be getting some output back, so those
>>> result set are getting stored somewhere in HDFS? If yes?
>>>
>>> 1) Then where they are getting stored and how can I access it?**
>>>
>>> 2) And is there any time limit on that meaning after this much
>>> particular time it will be deleted?**
>>>
>>>
>>> *Raihan Jamal*
>>>
>>>
>>
>
Re: Output from HiveQL query
Posted by Roberto Sanabria <ro...@stumbleupon.com>.
Or you can output to a table and store it there.
On Thu, Jul 12, 2012 at 2:53 PM, VanHuy Pham <hu...@gmail.com> wrote:
> The output can be printed out on terminal when you run it, or can be
> stored if you specify a location for it through the operator >.
> For example:
>
> /home/smith/bin/hive -f "file containing hive sql" >
> /home/smith/documents/output.txt
>
> On Thu, Jul 12, 2012 at 11:31 AM, Raihan Jamal <ja...@gmail.com>wrote:
>
>> I have one question related to the output from the HiveQL query. Suppose
>> I did some HiveQL query and I will be getting some output back, so those
>> result set are getting stored somewhere in HDFS? If yes?
>>
>> 1) Then where they are getting stored and how can I access it?**
>>
>> 2) And is there any time limit on that meaning after this much
>> particular time it will be deleted?**
>>
>>
>> *Raihan Jamal*
>>
>>
>
Re: Output from HiveQL query
Posted by VanHuy Pham <hu...@gmail.com>.
The output can be printed out on terminal when you run it, or can be stored
if you specify a location for it through the operator >.
For example:
/home/smith/bin/hive -f "file containing hive sql" >
/home/smith/documents/output.txt
On Thu, Jul 12, 2012 at 11:31 AM, Raihan Jamal <ja...@gmail.com>wrote:
> I have one question related to the output from the HiveQL query. Suppose I
> did some HiveQL query and I will be getting some output back, so those
> result set are getting stored somewhere in HDFS? If yes?
>
> 1) Then where they are getting stored and how can I access it?**
>
> 2) And is there any time limit on that meaning after this much
> particular time it will be deleted?**
>
>
> *Raihan Jamal*
>
>
Re: Output from HiveQL query
Posted by "kulkarni.swarnim@gmail.com" <ku...@gmail.com>.
By default, no. They will be displayed onto the console.
Try this to store them in HDFS:
INSERT OVERWRITE DIRECTORY '/tmp/hdfs_out' SELECT * FROM invites a
WHERE a.ds='2008-08-15';
The results of the query will be stored in '/tmp/hdfs_out' directory on HDFS.
I am not sure I understood your question about time limit. Once in
HDFS, it should be upto you to decide till when you want them to be
there right?
On Thu, Jul 12, 2012 at 1:31 PM, Raihan Jamal <ja...@gmail.com> wrote:
> I have one question related to the output from the HiveQL query. Suppose I
> did some HiveQL query and I will be getting some output back, so those
> result set are getting stored somewhere in HDFS? If yes?
>
> 1) Then where they are getting stored and how can I access it?**
>
> 2) And is there any time limit on that meaning after this much
> particular time it will be deleted?**
>
>
> *Raihan Jamal*
>
>
--
Swarnim