Member since
06-02-2017
2
Posts
0
Kudos Received
0
Solutions
06-05-2017
12:31 PM
I have a table which consists of eight column such as A,B,C,....H. Each column have some shortcodes such as U,V,W randomly.Now I need to count the no of U,V,W from each row.Some columns may have null or unknown value also. Here is a demo: A B C D E F G H U W V U W U U W V W W U V Here I need to use HiveQL.
... View more
Labels:
- Labels:
-
Apache Hadoop
-
Apache Hive
06-02-2017
08:05 AM
You need to create external table then load data either from local or from HDFS. CREATE EXTERNAL TABLE <table_name> (column1 <datatype>,column2 <datatype>,column3 <datatype>,...) ROW FORMAT DELIMITED STORED AS SEQUENCEFILE LOCATION '<location_path>';
Now Load data :
LOAD DATA INPATH '<HDFS PATH>' INTO <table_name>;
... View more