I am trying to use sqoop to import all tables in a database from SQL relational database into hive. Before doing that, I would like to know how many records are in each of the tables in my source database. This way, I can have how estimations of the impact to the source database and I want such impact to be small.
Is there a simple way to do that? I tried to use a query such as select count(*) from dbname.tbname
. It was not working. Here is what my sqoop looks like:
sqoop import -Dmapred.job.queue.name=$myqueue
--connect "jdbc:sqlserver://$svr;database=$db;username=$user;password=$pass"
--query "select count(*) from $tbname "
--target-dir $detdatadir/$filerecord -m3
Any help would be greatly appreciated.