Created 06-13-2016 03:04 AM
Hi..
I have set of .csv files in HDFS folder with different columns, i want to move this files to HIVE dynamically. How to move this set of files to HIVE ? please help me and thanks in advance
Created 06-13-2016 03:19 AM
Here is the sample code:
CREATE EXTERNAL TABLE IF NOT EXISTS Cars( Name STRING, Miles_per_Gallon INT, Cylinders INT, Displacement INT, Horsepower INT, Weight_in_lbs INT, Acceleration DECIMAL, Year DATE, Origin CHAR(1)) COMMENT 'Data about cars from a public database' ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE location '/user/<username>/visdata';
Link might help you more
Created 06-13-2016 03:19 AM
Here is the sample code:
CREATE EXTERNAL TABLE IF NOT EXISTS Cars( Name STRING, Miles_per_Gallon INT, Cylinders INT, Displacement INT, Horsepower INT, Weight_in_lbs INT, Acceleration DECIMAL, Year DATE, Origin CHAR(1)) COMMENT 'Data about cars from a public database' ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE location '/user/<username>/visdata';
Link might help you more
Created 06-13-2016 04:41 AM
thanks for ur reply sri but i have following doubt please give any solution
how to create the hive table dynamically based on the csv files.
for example, if csv1 file consists of 3 columns and csv2 file consists of 4 columns how to create hive table dynamically for both
Created 06-13-2016 04:40 AM
how to create the hive table dynamically based on the csv files.
for example, if csv1 file consists of 3 columns and csv2 file consists of 4 columns how to create hive table dynamically for both