Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Run simple HiveQL query using shell script?


Copy link to this message
-
Run simple HiveQL query using shell script?
I am new to Unix Shell Scripting world. I wanted to run a simple
*HiveQL*query from the Unix Shell script and output the result in a
.txt file and
then send that .txt file as an attachment in an email.

SQL Query and piping the output to a txt file is below:

    SELECT count(*) from pds_table > a.txt;

How can I do this from a shell script and send the output to a txt file and
then send that txt file as an attachment in an email.
*Raihan Jamal*
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB