Hive 批量导出建表语句

  1. #!/bin/bash
  2. rm -rf tablesDDL.txt
  3. for hiveTabName in $(hive -e "show tables 'rcd*';")
  4. do
  5. hive -e "show create table $hiveTabName" >>tablesDDL.txt
  6. echo -e "---------------------------- $hiveTabName table structure generate finished! -------------------------------\n\n">>tablesDDL.txt
  7. done