output=""
hive -S -e 'show databases' | while read database
do
eval "hive -S -e 'show tables in $database'" | while read line
do
if eval "hive -S -e 'describe $database.$line'" | grep -q "<column_name"; then
eval "hive -S -e 'show columns in $database.$line'" | while read column
do
output="$output$database.$line,$column"'\n'
done
fi
done
done
echo -e "$output"
1条答案
按热度按时间1l5u6lss1#
我认为在Hive里没有任何选择。您可以使用shell脚本来获得相同的输出。像这样: