我正在使用Java API访问HiveServer2,我需要在statements类的execute()方法中执行多个hive查询。是否可以在一次调用execute()方法时提交多个hive查询?我有设置hive属性的需求:
SET hive.exec.max.created.files=200000;
SET hive.exec.compress.output=true;
SET mapred.output.compression.codec=org.apache.hadoop.io.compress.SnappyCodec;
SET hive.exec.dynamic.partition = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
set hive.exec.max.dynamic.partitions=5000;
set hive.exec.max.dynamic.partitions.pernode=5000;
.
.
Statement stmt = con.createStatement();
stmt.execute("SET hive.exec.max.created.files=200000");
.
.
现在我正在使用 execute()方法逐个设置这些属性。有没有一种方法可以通过一次调用 execute() 方法来设置所有这些属性?
预期:
stmt.execute("SET hive.exec.max.created.files=200000;
SET hive.exec.dynamic.partition = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
set hive.exec.max.dynamic.partitions=5000;
set hive.exec.max.dynamic.partitions.pernode=5000;");
谢谢。