You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Amjad ALSHABANI <as...@gmail.com> on 2014/05/30 12:10:39 UTC

HDFS Overwriting undo

Hello Everybody,

I know that this question may concern Hadoop list but i ve made this
mistake when using Hive.
 I created new database giving the location on HDFS but i found that it
removed all other data that exist already.

=====
before creation, the directory on HDFS contains :
pns@app11:~$ hadoop fs -ls /user/hive/warehouse
Found 25 items
drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
*/user/hive/warehouse/*dfy_ans_autres
drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
/user/hive/warehouse/dfy_ans_maillog
drwxr-xr-x   - user1 supergroup          0 2013-11-20 14:28
/user/hive/warehouse/dfy_cnx
drwxr-xr-x   - user2           supergroup          0 2014-05-30 06:05
/user/hive/warehouse/pns.db
drwxr-xr-x   - user2          supergroup          0 2014-02-24 17:00
/user/hive/warehouse/pns_fr_integ
drwxr-xr-x   - user2          supergroup          0 2014-05-06 15:33
/user/hive/warehouse/pns_logstat.db


hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000
*/user/hive/warehouse/*mystats.db'"

but now I couldn't see the other directories on HDFS:

pns@app11:~/aalshabani$ hls /user/hive/warehouse
Found 1 items
drwxr-xr-x   - user2 supergroup          0 2014-05-30 11:37
*/user/hive/warehouse*/mystats.db


Is there anyway I could restore the other data??


Best regards.

Amjad

Re: HDFS Overwriting undo

Posted by Ashish Garg <ga...@gmail.com>.
hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000
*/user/hive/warehouse/*mystats.db'"

This command should be like as follows:
hive -e 'Create Database my_stats'

you do not need to specify the location because the default location of
database is the warehouse directory.


On Mon, Jun 2, 2014 at 3:57 AM, Amjad ALSHABANI <as...@gmail.com>
wrote:

> I think it is worth  to mention that I tried doing this before on locally
> deployed HDFS and it went well.
>
> So my question now, what has gone wrong with creation database with given
> location??
>
>
> thanx for your rplies
>
> Amjad
>
>
> On Mon, Jun 2, 2014 at 9:50 AM, Siddharth Tiwari <
> siddharth.tiwari@live.com> wrote:
>
>> Sorry Amzad, I am afraid u can't
>>
>> Sent from my iPhone
>>
>> On May 30, 2014, at 3:12 AM, "Amjad ALSHABANI" <as...@gmail.com>
>> wrote:
>>
>> Hello Everybody,
>>
>> I know that this question may concern Hadoop list but i ve made this
>> mistake when using Hive.
>>  I created new database giving the location on HDFS but i found that it
>> removed all other data that exist already.
>>
>> =====
>> before creation, the directory on HDFS contains :
>> pns@app11:~$ hadoop fs -ls /user/hive/warehouse
>> Found 25 items
>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
>> */user/hive/warehouse/*dfy_ans_autres
>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
>> /user/hive/warehouse/dfy_ans_maillog
>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 14:28
>> /user/hive/warehouse/dfy_cnx
>> drwxr-xr-x   - user2           supergroup          0 2014-05-30 06:05
>> /user/hive/warehouse/pns.db
>> drwxr-xr-x   - user2          supergroup          0 2014-02-24 17:00
>> /user/hive/warehouse/pns_fr_integ
>> drwxr-xr-x   - user2          supergroup          0 2014-05-06 15:33
>> /user/hive/warehouse/pns_logstat.db
>>
>>
>> hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000
>> */user/hive/warehouse/*mystats.db'"
>>
>> but now I couldn't see the other directories on HDFS:
>>
>> pns@app11:~/aalshabani$ hls /user/hive/warehouse
>> Found 1 items
>> drwxr-xr-x   - user2 supergroup          0 2014-05-30 11:37
>> */user/hive/warehouse*/mystats.db
>>
>>
>> Is there anyway I could restore the other data??
>>
>>
>> Best regards.
>>
>> Amjad
>>
>>
>>
>>
>

Re: HDFS Overwriting undo

Posted by Amjad ALSHABANI <as...@gmail.com>.
I think it is worth  to mention that I tried doing this before on locally
deployed HDFS and it went well.

So my question now, what has gone wrong with creation database with given
location??


thanx for your rplies

Amjad


On Mon, Jun 2, 2014 at 9:50 AM, Siddharth Tiwari <si...@live.com>
wrote:

> Sorry Amzad, I am afraid u can't
>
> Sent from my iPhone
>
> On May 30, 2014, at 3:12 AM, "Amjad ALSHABANI" <as...@gmail.com>
> wrote:
>
> Hello Everybody,
>
> I know that this question may concern Hadoop list but i ve made this
> mistake when using Hive.
>  I created new database giving the location on HDFS but i found that it
> removed all other data that exist already.
>
> =====
> before creation, the directory on HDFS contains :
> pns@app11:~$ hadoop fs -ls /user/hive/warehouse
> Found 25 items
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
> */user/hive/warehouse/*dfy_ans_autres
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
> /user/hive/warehouse/dfy_ans_maillog
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 14:28
> /user/hive/warehouse/dfy_cnx
> drwxr-xr-x   - user2           supergroup          0 2014-05-30 06:05
> /user/hive/warehouse/pns.db
> drwxr-xr-x   - user2          supergroup          0 2014-02-24 17:00
> /user/hive/warehouse/pns_fr_integ
> drwxr-xr-x   - user2          supergroup          0 2014-05-06 15:33
> /user/hive/warehouse/pns_logstat.db
>
>
> hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000
> */user/hive/warehouse/*mystats.db'"
>
> but now I couldn't see the other directories on HDFS:
>
> pns@app11:~/aalshabani$ hls /user/hive/warehouse
> Found 1 items
> drwxr-xr-x   - user2 supergroup          0 2014-05-30 11:37
> */user/hive/warehouse*/mystats.db
>
>
> Is there anyway I could restore the other data??
>
>
> Best regards.
>
> Amjad
>
>
>
>

Re: HDFS Overwriting undo

Posted by Siddharth Tiwari <si...@live.com>.
Sorry Amzad, I am afraid u can't 

Sent from my iPhone

> On May 30, 2014, at 3:12 AM, "Amjad ALSHABANI" <as...@gmail.com> wrote:
> 
> Hello Everybody,
> 
> I know that this question may concern Hadoop list but i ve made this mistake when using Hive.
>  I created new database giving the location on HDFS but i found that it removed all other data that exist already.
> 
> =====
> before creation, the directory on HDFS contains :
> pns@app11:~$ hadoop fs -ls /user/hive/warehouse
> Found 25 items
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40 /user/hive/warehouse/dfy_ans_autres
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40 /user/hive/warehouse/dfy_ans_maillog
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 14:28 /user/hive/warehouse/dfy_cnx
> drwxr-xr-x   - user2           supergroup          0 2014-05-30 06:05 /user/hive/warehouse/pns.db
> drwxr-xr-x   - user2          supergroup          0 2014-02-24 17:00 /user/hive/warehouse/pns_fr_integ
> drwxr-xr-x   - user2          supergroup          0 2014-05-06 15:33 /user/hive/warehouse/pns_logstat.db
> 
> 
> hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000/user/hive/warehouse/mystats.db'"
> 
> but now I couldn't see the other directories on HDFS:
> 
> pns@app11:~/aalshabani$ hls /user/hive/warehouse
> Found 1 items
> drwxr-xr-x   - user2 supergroup          0 2014-05-30 11:37 /user/hive/warehouse/mystats.db
> 
> 
> Is there anyway I could restore the other data??
> 
> 
> Best regards.
> 
> Amjad
> 
> 
> 

Re: HDFS Overwriting undo

Posted by VinodKasam <vi...@gmail.com>.
Hi,

The command to check if the file exists recursively is hadoop fs -lsr

Vinod


On Mon, Jun 2, 2014 at 12:40 AM, Amjad ALSHABANI <as...@gmail.com>
wrote:

> Hello Ashish,
>
> Unfortunately,I got this error when running the commande you provided:
>
> pns@app11:~$ hadoop fs -ls -lrt /user/hive/warehouse
> -ls: Illegal option -lrt
> Usage: hadoop fs [generic options] -ls [-d] [-h] [-R] [<path> ...]
>
>
>
> On Sun, Jun 1, 2014 at 8:17 PM, Ashish Garg <ga...@gmail.com>
> wrote:
>
>> Try this command:
>> hadoop fs -ls -lrt /user/hive/warehouse/
>>
>> Regards.
>>
>>
>> On Fri, May 30, 2014 at 6:10 AM, Amjad ALSHABANI <as...@gmail.com>
>> wrote:
>>
>>> Hello Everybody,
>>>
>>> I know that this question may concern Hadoop list but i ve made this
>>> mistake when using Hive.
>>>  I created new database giving the location on HDFS but i found that it
>>> removed all other data that exist already.
>>>
>>> =====
>>> before creation, the directory on HDFS contains :
>>> pns@app11:~$ hadoop fs -ls /user/hive/warehouse
>>> Found 25 items
>>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
>>> */user/hive/warehouse/*dfy_ans_autres
>>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
>>> /user/hive/warehouse/dfy_ans_maillog
>>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 14:28
>>> /user/hive/warehouse/dfy_cnx
>>> drwxr-xr-x   - user2           supergroup          0 2014-05-30 06:05
>>> /user/hive/warehouse/pns.db
>>> drwxr-xr-x   - user2          supergroup          0 2014-02-24 17:00
>>> /user/hive/warehouse/pns_fr_integ
>>> drwxr-xr-x   - user2          supergroup          0 2014-05-06 15:33
>>> /user/hive/warehouse/pns_logstat.db
>>>
>>>
>>> hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000
>>> */user/hive/warehouse/*mystats.db'"
>>>
>>> but now I couldn't see the other directories on HDFS:
>>>
>>> pns@app11:~/aalshabani$ hls /user/hive/warehouse
>>> Found 1 items
>>> drwxr-xr-x   - user2 supergroup          0 2014-05-30 11:37
>>> */user/hive/warehouse*/mystats.db
>>>
>>>
>>> Is there anyway I could restore the other data??
>>>
>>>
>>> Best regards.
>>>
>>> Amjad
>>>
>>>
>>>
>>>
>>
>

Re: HDFS Overwriting undo

Posted by Amjad ALSHABANI <as...@gmail.com>.
Hello Ashish,

Unfortunately,I got this error when running the commande you provided:

pns@app11:~$ hadoop fs -ls -lrt /user/hive/warehouse
-ls: Illegal option -lrt
Usage: hadoop fs [generic options] -ls [-d] [-h] [-R] [<path> ...]



On Sun, Jun 1, 2014 at 8:17 PM, Ashish Garg <ga...@gmail.com>
wrote:

> Try this command:
> hadoop fs -ls -lrt /user/hive/warehouse/
>
> Regards.
>
>
> On Fri, May 30, 2014 at 6:10 AM, Amjad ALSHABANI <as...@gmail.com>
> wrote:
>
>> Hello Everybody,
>>
>> I know that this question may concern Hadoop list but i ve made this
>> mistake when using Hive.
>>  I created new database giving the location on HDFS but i found that it
>> removed all other data that exist already.
>>
>> =====
>> before creation, the directory on HDFS contains :
>> pns@app11:~$ hadoop fs -ls /user/hive/warehouse
>> Found 25 items
>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
>> */user/hive/warehouse/*dfy_ans_autres
>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
>> /user/hive/warehouse/dfy_ans_maillog
>> drwxr-xr-x   - user1 supergroup          0 2013-11-20 14:28
>> /user/hive/warehouse/dfy_cnx
>> drwxr-xr-x   - user2           supergroup          0 2014-05-30 06:05
>> /user/hive/warehouse/pns.db
>> drwxr-xr-x   - user2          supergroup          0 2014-02-24 17:00
>> /user/hive/warehouse/pns_fr_integ
>> drwxr-xr-x   - user2          supergroup          0 2014-05-06 15:33
>> /user/hive/warehouse/pns_logstat.db
>>
>>
>> hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000
>> */user/hive/warehouse/*mystats.db'"
>>
>> but now I couldn't see the other directories on HDFS:
>>
>> pns@app11:~/aalshabani$ hls /user/hive/warehouse
>> Found 1 items
>> drwxr-xr-x   - user2 supergroup          0 2014-05-30 11:37
>> */user/hive/warehouse*/mystats.db
>>
>>
>> Is there anyway I could restore the other data??
>>
>>
>> Best regards.
>>
>> Amjad
>>
>>
>>
>>
>

Re: HDFS Overwriting undo

Posted by Ashish Garg <ga...@gmail.com>.
Try this command:
hadoop fs -ls -lrt /user/hive/warehouse/

Regards.


On Fri, May 30, 2014 at 6:10 AM, Amjad ALSHABANI <as...@gmail.com>
wrote:

> Hello Everybody,
>
> I know that this question may concern Hadoop list but i ve made this
> mistake when using Hive.
>  I created new database giving the location on HDFS but i found that it
> removed all other data that exist already.
>
> =====
> before creation, the directory on HDFS contains :
> pns@app11:~$ hadoop fs -ls /user/hive/warehouse
> Found 25 items
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
> */user/hive/warehouse/*dfy_ans_autres
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 13:40
> /user/hive/warehouse/dfy_ans_maillog
> drwxr-xr-x   - user1 supergroup          0 2013-11-20 14:28
> /user/hive/warehouse/dfy_cnx
> drwxr-xr-x   - user2           supergroup          0 2014-05-30 06:05
> /user/hive/warehouse/pns.db
> drwxr-xr-x   - user2          supergroup          0 2014-02-24 17:00
> /user/hive/warehouse/pns_fr_integ
> drwxr-xr-x   - user2          supergroup          0 2014-05-06 15:33
> /user/hive/warehouse/pns_logstat.db
>
>
> hive -e "CREATE DATABASE my_stats LOCATION 'hdfs://XXXX:9000
> */user/hive/warehouse/*mystats.db'"
>
> but now I couldn't see the other directories on HDFS:
>
> pns@app11:~/aalshabani$ hls /user/hive/warehouse
> Found 1 items
> drwxr-xr-x   - user2 supergroup          0 2014-05-30 11:37
> */user/hive/warehouse*/mystats.db
>
>
> Is there anyway I could restore the other data??
>
>
> Best regards.
>
> Amjad
>
>
>
>