Unix 是否将同一配置单元会话中的多个查询输出导出到shell脚本?

Unix 是否将同一配置单元会话中的多个查询输出导出到shell脚本?,unix,hadoop,hive,yarn,Unix,Hadoop,Hive,Yarn,是否有方法将配置单元CLI中多个配置单元查询的输出导出到shell脚本 目前,我有一个shell脚本,其中有多个配置单元查询,我将触发: VAR1=`hive -e "select count(*) from table1;"` VAR2=`hive -e "select count(*) from table2;"` VAR3=`hive -e "select count(*) from table3;"` 这将在一个单独的配置单元会话中运行所有查询,这将导致它在会话中等待资源。相反,我希望

是否有方法将配置单元CLI中多个配置单元查询的输出导出到shell脚本

目前,我有一个shell脚本,其中有多个配置单元查询,我将触发:

VAR1=`hive -e "select count(*) from table1;"`
VAR2=`hive -e "select count(*) from table2;"`
VAR3=`hive -e "select count(*) from table3;"`
这将在一个单独的配置单元会话中运行所有查询,这将导致它在会话中等待资源。相反,我希望在同一个配置单元会话中运行它们

`hive -e "select count(*) from table1;select count(*) from table2;select count(*) from table3;"`
并将传递给shell脚本的输出转换为VAR1、VAR2和VAR3。可能吗

尝试子查询

select c1.*, c2.*, c3.* from 
(select count(*) from table1) c1, 
(select count(*) from table2) c2, 
(select count(*) from table3) c3;
尝试子查询

select c1.*, c2.*, c3.* from 
(select count(*) from table1) c1, 
(select count(*) from table2) c2, 
(select count(*) from table3) c3;

我想利用这个链接中提到的内容:我的一些子查询很复杂,因此最好将它们分解。我想利用这个链接中提到的内容:我的一些子查询很复杂,因此最好将它们分解。