AnsweredAssumed Answered

Need a Suggestion - HIVE dynamic Location Issue

Question asked by pratap_hp on Oct 20, 2015
Here with I am facing an issue while I have created an external HIVE table using the Location dynamically,While I am using a direct Hierarchy folder structure , it works fine
I have another scenario where My Hierarchy structure as follow in the below example
as while i am linking the folder it takes wrong data from the two layer of sub folder as subfolder contain other module too.

Example :

RootFolder -- >Date wise folder  - > Module 1  -->Part001,part002,part003
                                                    Module 2 -->part001,part005
                                                    Module 3 --> part002,part004

                 -->Next Date wise folder -- > Module 1  -->Part001,part002,part003
                                                            Module 2 -->part001,part005
                                                             Module 3 --> part002,part004

create a external table "Module1" it should take from all the DateWise folder which in Root folder.

create table Module 1
(col1,col22....)
ROW FORMAT DELIMITED   
FIELDS TERMINATED BY '|'   
STORED AS TEXTFILE   
LOCATION '/RootFolder/*

Outcomes