如何使用 Hive JDBC 连接获取 Hive 应用程序 ID

How to get Hive Application Id using Hive JDBC connection

我是这样运行通过hive查询的JDBC

Class.forName(DRIVER);
Connection = DriverManager.getConnection(CONNECTION_URL, USERNAME, PASSWORD);

Response = Connection.createStatement();
ResultSet = Response.executeQuery(query);

来自 YARN URL,无法找到应用程序 ID。

Class.forName(DRIVER);
Connection = DriverManager.getConnection(CONNECTION_URL, USERNAME, PASSWORD);

HiveStatement stmt = (HiveStatement) Connection.createStatement();

ResultSet = stmt.executeQuery(query);

for(String log: stmt.getQueryLog()) {

      System.out.println("Log: "+log)
}