Skip to main content

Posts

Showing posts with the label Hive

Generating HTML Report From Hive and Sending thru Email

Script to Generate HTML Rpt #!/bin/ksh TODAY = `date +'%Y %b %d'` rm file.csv rm report.html #Hive Query to Fetch Results from Hive Table hive -S -e "SELECT COLA,COLB FROM hive_tbl;" > file.csv #Convert the Results to Comma Separated sed - i 's/\t/,/g' file.csv #awk command to parse the file #recCNT=`awk -F ',' '{print $1}' file.csv #Converting CSV File to HTML echo "<HTML><BODY>" > report.html echo "<h2><font color=blue>Report Header</font></h2>" >> report.html #loop through records in CSV and Convert to Table awk 'BEGIN{ FS="," print "<TABLE border="1"><TH><font color=brown><center> COLA HEADER</center></font></TH><TH><font color=b...