#!/bin/bash
#日志目录
#shell判断表hive表是否存在
#TABLE=库名.表名
TABLE=dal.dal_mdn_communication_behavior
hive -e"
desc $TABLE;
" 2>&1 | grep 'Table not found'
rtstatus=$?
echo $rtstatus
if [ $rtstatus -ne 0 ]; then
echo "hbase表已存在"
else
echo "hbase表不存在"
fi
以上内容,仅作为自己学习使用