You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Ramasubramanian <ra...@gmail.com> on 2012/09/15 18:17:18 UTC
How to overwrite a file inside hive table folder
Hi,
We could not overwrite a file inside hive table folder. What is the command to over write it.
Regards,
Rams
Re: How to overwrite a file inside hive table folder
Posted by Ruslan Al-Fakikh <me...@gmail.com>.
Hi,
I think you could try to drop partition and create a new partition if
you table is partitioned
Ruslan
On Mon, Sep 17, 2012 at 8:12 AM, MiaoMiao <li...@gmail.com> wrote:
> What do you mean by "a file"? If your HDFS dir contains several file
> and you want to overwrite one, then no way you can do it with HiveQL.
> You can check out this link and see if it suits you.
>
> https://cwiki.apache.org/Hive/languagemanual-dml.html#LanguageManualDML-Writingdataintofilesystemfromqueries
>
> My way of exporting hiveql result as a single is this:
> echo "some,column,name">some.file
> hive -S -e "select some, column, name from some_table"|sed -e
> "s/\t/,/" >> some.file
> On Sun, Sep 16, 2012 at 12:17 AM, Ramasubramanian
> <ra...@gmail.com> wrote:
>> Hi,
>>
>> We could not overwrite a file inside hive table folder. What is the command to over write it.
>>
>> Regards,
>> Rams
Re: How to overwrite a file inside hive table folder
Posted by MiaoMiao <li...@gmail.com>.
What do you mean by "a file"? If your HDFS dir contains several file
and you want to overwrite one, then no way you can do it with HiveQL.
You can check out this link and see if it suits you.
https://cwiki.apache.org/Hive/languagemanual-dml.html#LanguageManualDML-Writingdataintofilesystemfromqueries
My way of exporting hiveql result as a single is this:
echo "some,column,name">some.file
hive -S -e "select some, column, name from some_table"|sed -e
"s/\t/,/" >> some.file
On Sun, Sep 16, 2012 at 12:17 AM, Ramasubramanian
<ra...@gmail.com> wrote:
> Hi,
>
> We could not overwrite a file inside hive table folder. What is the command to over write it.
>
> Regards,
> Rams