private DatabaseRule getDatabaseRule(String metastoreType) {
    switch (metastoreType) {
    case "postgres":
      return new Postgres();
    case "postgres.tpcds":
      return new PostgresTPCDS();
    case "oracle":
      return new Oracle();
    case "mysql":
      return new Mysql();
    case "mssql":
    case "sqlserver":
      return new Mssql();
    default:
      return new Derby();
    }
  }
QTestMetaStoreHandler is responsible for wrapping the logic of handling different metastore
databases in qtests.
itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestMetaStoreHandler.java