hive -e "select count (*) from table where year=2019 and month=04 and day=15"
这个命令给我的结果是15在下面的格式
+----+ | a | +----+ | 15 | +----+
如何将值设为15而不是上述格式?
kzmpq1sx1#
hive -e "select count (*) from table where year=2019 and month=04 and day=15" | grep -o '[0-9]*'
这个 -o 开关仅从输入输出该部分,该部分实际上与模式相对应。
-o
tzcvj98z2#
下面的代码将对您有所帮助。
a=$(hive -e "select count (*) from table where year=2019 and month=04 and day=15") echo $a
2条答案
按热度按时间kzmpq1sx1#
这个
-o
开关仅从输入输出该部分,该部分实际上与模式相对应。tzcvj98z2#
下面的代码将对您有所帮助。