我需要经常在表上收集增量统计信息,为此,我需要填充以下变量的最新分区:
compute incremental stats someSchema.someTable partition (partitionColName=${value});
我没有多少选择,我不想用于稳定性和性能问题,下面是我使用shell脚本的选项:
TabMaxPartDt=$(impala-shell --ssl -k -i ${ConnString} -B -q "select max(PartitionColName) from someSchema.someTableName")
#Collecting the stats using the variable TabMaxPartDt
compute incremental stats someSchema.someTable partition (partitionColName=${TabMaxPartDt});
#Other dirty and easiest option is to predict the date with the current date as I'm doing the partition with current date
dt=$(date +"%Y%m%d")
compute incremental stats someSchema.someTable partition (partitionColName=${dt});
我想知道impala中是否有任何选项可以在不运行内存消耗查询的情况下获取最新分区?并且没有猜测分区?
我试图在impala doc中找到show latest partition tableName;
之类的内容show partitions tableName
,但没有运气。
提前致谢!!