Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎08-06-2018

How to call hiveconf in perl programming.

Dear Team,

 

Like shell script, how can we call hql using hiveconf in perl programming.

 

I want to insert data into the table passing perl variable.

 

Like in shell script : 

SOURCE=$1

AUDIT_DATE=$2

hive --hiveconf SOURCE="${SOURCE}" --hiveconf AUDIT_DATE="${AUDIT_DATE}" -S -f /CODEBASE/AUDIT/Mod_Audit_lodging.sql

Mod_Audit_lodging.sql : 

INSERT INTO  test.WORKFLOW_DETAILED_AUDIT_FILE PARTITION (AUDIT_DATE='${hiveconf:AUDIT_DATE}') SELECT TRIM(FILE_RECORD_COUNT),TRIM(FILENAME),TRIM(JOBNAME),TRIM(PROGRAM),TRIM(SOURCE),TRIM(BATCH_ID) FROM test.WORKFLOW_DETAILED_AUDIT_FILE_STG where trim(SOURCE)='${hiveconf:SOURCE}';

 

how can we implement same in perl programming ?

 

 

Kindly guide.

 

Regards

Announcements