Skip to main content

load data from hive partition table

  • January 31, 2016
  • 4 replies
  • 16 views

Reu
  • New Participant

Hi!

 

How i can load data  into vertica from hive partition table?

i used with hdfs connector by following steps:

CREATE external TABLE UR_MD_TEST11 (GN_CDR_ID DOUBLE PRECISION,year integer,month integer,day integer,hour integer,minute integer)
dbadmin-> AS COPY source Hdfs(url='http://nd1:50070/webhdfs/v1/user/hive/warehouse/ur_reu/*/*/*/*/*/', username='hdfs') DELIMITER E'\001' ;
CREATE TABLE
dbadmin=> select count(*) from UR_MD_TEST11;
ERROR 3399: Failure in UDx RPC call InvokePlanUDL(): Error calling planUDL() in User Defined Object [Hdfs] at [src/Hdfs.cpp:965], error code: 0, message: [http://hdfs@nd1:50070/webhdfs/v1/user/hive/warehouse/ur_reu/year=2014/month=201408/day=20140808/hour=2014080806/minute=201408080615/] is a directory.

4 replies

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • January 31, 2016

Hi,

 

     What does wildcard * indicate ?/ur_reu/*/*/*/*/*/ .  It looks like a subdirectory exists in the  HDFSFilePath ([http://hdfs@nd1:50070/webhdfs/v1/user/hive/warehouse/ur_reu/year=2014/month=201408/day=20140808/hour=2014080806/minute=201408080615) you have specified.

 

Can you cross check??

 

Thank you,

Sruthi


Reu
  • Author
  • New Participant
  • February 1, 2016

yes it subdirectory because as i have write it hive partition tables with 4 keys:

year,month,day,hour ,minute

year=2014/month=201408/day=20140808/hour=2014080806/minute=201408080615

 

i moved all partition keys from create external tables and it working as i expected.

THank you :

 CREATE external  TABLE UR_MD_TEST11 (GN_CDR_ID DOUBLE PRECISION)
dbadmin-> AS COPY  source Hdfs(url='http://nd1:50070/webhdfs/v1/user/hive/warehouse/ur_reu/*/*/*/*/*/*', username='hdfs')  DELIMITER E'\001';

 

 

 

 


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • February 1, 2016

Hi,

 

     Good to know it is working.

 

 

Thank you,

Sruthi


Multiverse
  • New Participant
  • August 7, 2016

Is it possible to reference the directory-based partition implicit columns, such as:

... WHERE Year = '2016'