Hadoop insertion without selection

I'm new to Hadoop, I need to insert a record into the table when I look for syntax, each where the insert statement has values โ€‹โ€‹from the select statement.

Is there a way to insert simple values โ€‹โ€‹without a Select statement?

Regards, Sathish.

+4
source share
1 answer

First, I guess the tag we're talking about is HIV.

When you really use the bush, you will never have a reason to add entries one at a time.

The easiest way to do this, I think, is to first create a CSV file with your data.

sample.csv Dan,50 Dave,20 Sam,30 

Then we put the file in hdfs

 hadoop fs -copyFromLocal ./sample.csv /user/me/sample.csv 

Now we go to the hive and create our table with our data.

 $ hive hive> Create EXTERNAL TABLE IF NOT EXISTS sample(NAME STRING, Grade int) hive> ROW FORMATED DELIMITED FILED TERMINATED BY ',' hive> STORED AS TEXTFILE location '/user/me/sample.csv'; 
+2
source

All Articles