读取参数
opts=$@getparam(){arg=$1echo $opts | xargs -n1 | cut -b 2- | awk -F '=' '{if($1=="'"$arg"'") print $2 }'}解释:1. 脚本名称叫test.sh 入参三个: 1 2 3运行test.sh 1 2 3后$*为"1 2 3"(一起被引号包住)$@为"1" "2" "3"(分别被包住)$#为3(参数数量)2. ...
union all
目前在hive中使用union all时,如果两个或多个union all 子查询从同一张表取数且每个子查询where语句不同时,hive会把多个where条件组合到一起使用,这样可能会导致数据缺失(从不同的表取数不会有问题)。解决办法:改union all为insert into或改用spark-sql提交。...