public void setHiveSessionValue(String key, String value) {
    Preconditions.checkState(session.get() != null, "There is no open session for setting variables.");
    try {
      session.get().getSessionConf().set(key, value);
    } catch (Exception e) {
      throw new RuntimeException("Unable to set Hive session variable: ", e);
    }
  }
Test class for running HiveQL queries, essentially acting like a Beeline shell in tests.

It spins up both an HS2 and a Metastore instance to work with. The shell will only accept
queries if it has been previously initialized via {@link #start()}, and a session has been opened via
{@link #openSession()}. Prior to calling {@link #start()}, the shell should first be configured with props that apply
across all test cases by calling {@link #setHiveConfValue(String, String)} ()}. On the other hand, session-level conf
can be applied anytime via {@link #setHiveSessionValue(String, String)} ()}, once we've opened an active session.
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveShell.java