You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vi...@apache.org on 2018/07/19 19:55:11 UTC

[12/51] [partial] hive git commit: HIVE-20188 : Split server-specific code outside of standalone metastore-common (Alexander Kolbasov reviewed by Vihang Karajgaonkar)

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetastoreVersionInfo.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetastoreVersionInfo.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetastoreVersionInfo.java
deleted file mode 100644
index de54ff3..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetastoreVersionInfo.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.hive.metastore.utils;
-
-import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.classification.InterfaceStability;
-import org.apache.hadoop.hive.metastore.annotation.MetastoreVersionAnnotation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Class that uses package information to figure out which version of the metastore this program is.
- */
-@InterfaceAudience.Private
-@InterfaceStability.Unstable
-public class MetastoreVersionInfo {
-  private static final Logger LOG = LoggerFactory.getLogger(MetastoreVersionInfo.class);
-
-  private static Package myPackage;
-  private static MetastoreVersionAnnotation version;
-
-  static {
-    myPackage = MetastoreVersionAnnotation.class.getPackage();
-    version = myPackage.getAnnotation(MetastoreVersionAnnotation.class);
-  }
-
-  /**
-   * Get the meta-data for the Hive package.
-   * @return
-   */
-  static Package getPackage() {
-    return myPackage;
-  }
-
-  /**
-   * Get the Hive version.
-   * @return the Hive version string, eg. "0.6.3-dev"
-   */
-  public static String getVersion() {
-    return version != null ? version.version() : "Unknown";
-  }
-
-  /**
-   * Get the Hive short version, with major/minor/change version numbers.
-   * @return short version string, eg. "0.6.3"
-   */
-  public static String getShortVersion() {
-    return version != null ? version.shortVersion() : "Unknown";
-  }
-
-  /**
-   * Get the git revision number for the root directory
-   * @return the revision number, eg. "451451"
-   */
-  public static String getRevision() {
-    return version != null ? version.revision() : "Unknown";
-  }
-
-  /**
-   * Get the branch on which this originated.
-   * @return The branch name, e.g. "trunk" or "branches/branch-0.20"
-   */
-  public static String getBranch() {
-    return version != null ? version.branch() : "Unknown";
-  }
-
-  /**
-   * The date that Hive was compiled.
-   * @return the compilation date in unix date format
-   */
-  public static String getDate() {
-    return version != null ? version.date() : "Unknown";
-  }
-
-  /**
-   * The user that compiled Hive.
-   * @return the username of the user
-   */
-  public static String getUser() {
-    return version != null ? version.user() : "Unknown";
-  }
-
-  /**
-   * Get the git URL for the root Hive directory.
-   */
-  public static String getUrl() {
-    return version != null ? version.url() : "Unknown";
-  }
-
-  /**
-   * Get the checksum of the source files from which Hive was
-   * built.
-   **/
-  public static String getSrcChecksum() {
-    return version != null ? version.srcChecksum() : "Unknown";
-  }
-
-  /**
-   * Returns the buildVersion which includes version,
-   * revision, user and date.
-   */
-  public static String getBuildVersion(){
-    return MetastoreVersionInfo.getVersion() +
-    " from " + MetastoreVersionInfo.getRevision() +
-    " by " + MetastoreVersionInfo.getUser() +
-    " source checksum " + MetastoreVersionInfo.getSrcChecksum();
-  }
-
-  public static void main(String[] args) {
-    LOG.debug("version: "+ version);
-    System.out.println("Hive " + getVersion());
-    System.out.println("Git " + getUrl() + " -r " + getRevision());
-    System.out.println("Compiled by " + getUser() + " on " + getDate());
-    System.out.println("From source with checksum " + getSrcChecksum());
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/SecurityUtils.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/SecurityUtils.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/SecurityUtils.java
deleted file mode 100644
index 0b0cfbd..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/SecurityUtils.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.hive.metastore.utils;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.metastore.security.DBTokenStore;
-import org.apache.hadoop.hive.metastore.security.DelegationTokenIdentifier;
-import org.apache.hadoop.hive.metastore.security.DelegationTokenSelector;
-import org.apache.hadoop.hive.metastore.security.MemoryTokenStore;
-import org.apache.hadoop.hive.metastore.security.ZooKeeperTokenStore;
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.security.SecurityUtil;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hadoop.security.authentication.util.KerberosUtil;
-import org.apache.hadoop.security.token.Token;
-import org.apache.hadoop.security.token.TokenIdentifier;
-import org.apache.hadoop.security.token.TokenSelector;
-import org.apache.zookeeper.client.ZooKeeperSaslClient;
-
-import javax.security.auth.login.AppConfigurationEntry;
-import org.apache.thrift.transport.TSSLTransportFactory;
-import org.apache.thrift.transport.TServerSocket;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.net.ssl.SSLParameters;
-import javax.net.ssl.SSLServerSocket;
-import javax.net.ssl.SSLSocket;
-import javax.security.auth.login.LoginException;
-import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class SecurityUtils {
-  private static final Logger LOG = LoggerFactory.getLogger(SecurityUtils.class);
-
-  public static UserGroupInformation getUGI() throws LoginException, IOException {
-    String doAs = System.getenv("HADOOP_USER_NAME");
-    if (doAs != null && doAs.length() > 0) {
-     /*
-      * this allows doAs (proxy user) to be passed along across process boundary where
-      * delegation tokens are not supported.  For example, a DDL stmt via WebHCat with
-      * a doAs parameter, forks to 'hcat' which needs to start a Session that
-      * proxies the end user
-      */
-      return UserGroupInformation.createProxyUser(doAs, UserGroupInformation.getLoginUser());
-    }
-    return UserGroupInformation.getCurrentUser();
-  }
-  /**
-   * Dynamically sets up the JAAS configuration that uses kerberos
-   * @param principal
-   * @param keyTabFile
-   * @throws IOException
-   */
-  public static void setZookeeperClientKerberosJaasConfig(String principal, String keyTabFile) throws IOException {
-    // ZooKeeper property name to pick the correct JAAS conf section
-    final String SASL_LOGIN_CONTEXT_NAME = "HiveZooKeeperClient";
-    System.setProperty(ZooKeeperSaslClient.LOGIN_CONTEXT_NAME_KEY, SASL_LOGIN_CONTEXT_NAME);
-
-    principal = SecurityUtil.getServerPrincipal(principal, "0.0.0.0");
-    JaasConfiguration jaasConf = new JaasConfiguration(SASL_LOGIN_CONTEXT_NAME, principal, keyTabFile);
-
-    // Install the Configuration in the runtime.
-    javax.security.auth.login.Configuration.setConfiguration(jaasConf);
-  }
-
-  /**
-   * A JAAS configuration for ZooKeeper clients intended to use for SASL
-   * Kerberos.
-   */
-  private static class JaasConfiguration extends javax.security.auth.login.Configuration {
-    // Current installed Configuration
-    private static final boolean IBM_JAVA = System.getProperty("java.vendor")
-      .contains("IBM");
-    private final javax.security.auth.login.Configuration baseConfig = javax.security.auth.login.Configuration
-        .getConfiguration();
-    private final String loginContextName;
-    private final String principal;
-    private final String keyTabFile;
-
-    public JaasConfiguration(String hiveLoginContextName, String principal, String keyTabFile) {
-      this.loginContextName = hiveLoginContextName;
-      this.principal = principal;
-      this.keyTabFile = keyTabFile;
-    }
-
-    @Override
-    public AppConfigurationEntry[] getAppConfigurationEntry(String appName) {
-      if (loginContextName.equals(appName)) {
-        Map<String, String> krbOptions = new HashMap<String, String>();
-        if (IBM_JAVA) {
-          krbOptions.put("credsType", "both");
-          krbOptions.put("useKeytab", keyTabFile);
-        } else {
-          krbOptions.put("doNotPrompt", "true");
-          krbOptions.put("storeKey", "true");
-          krbOptions.put("useKeyTab", "true");
-          krbOptions.put("keyTab", keyTabFile);
-        }
-  krbOptions.put("principal", principal);
-        krbOptions.put("refreshKrb5Config", "true");
-        AppConfigurationEntry hiveZooKeeperClientEntry = new AppConfigurationEntry(
-            KerberosUtil.getKrb5LoginModuleName(), LoginModuleControlFlag.REQUIRED, krbOptions);
-        return new AppConfigurationEntry[] { hiveZooKeeperClientEntry };
-      }
-      // Try the base config
-      if (baseConfig != null) {
-        return baseConfig.getAppConfigurationEntry(appName);
-      }
-      return null;
-    }
-  }
-  
-  /**
-   * Get the string form of the token given a token signature. The signature is used as the value of
-   * the "service" field in the token for lookup. Ref: AbstractDelegationTokenSelector in Hadoop. If
-   * there exists such a token in the token cache (credential store) of the job, the lookup returns
-   * that. This is relevant only when running against a "secure" hadoop release The method gets hold
-   * of the tokens if they are set up by hadoop - this should happen on the map/reduce tasks if the
-   * client added the tokens into hadoop's credential store in the front end during job submission.
-   * The method will select the hive delegation token among the set of tokens and return the string
-   * form of it
-   * 
-   * @param tokenSignature
-   * @return the string form of the token found
-   * @throws IOException
-   */
-  public static String getTokenStrForm(String tokenSignature) throws IOException {
-    UserGroupInformation ugi = UserGroupInformation.getCurrentUser();
-    TokenSelector<? extends TokenIdentifier> tokenSelector = new DelegationTokenSelector();
-
-    Token<? extends TokenIdentifier> token = tokenSelector.selectToken(
-        tokenSignature == null ? new Text() : new Text(tokenSignature), ugi.getTokens());
-    return token != null ? token.encodeToUrlString() : null;
-  }
-  
-  /**
-   * Create a delegation token object for the given token string and service. Add the token to given
-   * UGI
-   * 
-   * @param ugi
-   * @param tokenStr
-   * @param tokenService
-   * @throws IOException
-   */
-  public static void setTokenStr(UserGroupInformation ugi, String tokenStr, String tokenService)
-      throws IOException {
-    Token<DelegationTokenIdentifier> delegationToken = createToken(tokenStr, tokenService);
-    ugi.addToken(delegationToken);
-  }
-
-  /**
-   * Create a new token using the given string and service
-   * 
-   * @param tokenStr
-   * @param tokenService
-   * @return
-   * @throws IOException
-   */
-  private static Token<DelegationTokenIdentifier> createToken(String tokenStr, String tokenService)
-      throws IOException {
-    Token<DelegationTokenIdentifier> delegationToken = new Token<DelegationTokenIdentifier>();
-    delegationToken.decodeFromUrlString(tokenStr);
-    delegationToken.setService(new Text(tokenService));
-    return delegationToken;
-  }
-
-  private static final String DELEGATION_TOKEN_STORE_CLS = "hive.cluster.delegation.token.store.class";
-
-  /**
-   * This method should be used to return the metastore specific tokenstore class name to main
-   * backwards compatibility
-   * 
-   * @param conf - HiveConf object
-   * @return the tokenStoreClass name from the HiveConf. It maps the hive specific tokenstoreclass
-   *         name to metastore module specific class name. For eg:
-   *         hive.cluster.delegation.token.store.class is set to
-   *         org.apache.hadoop.hive.thrift.MemoryTokenStore it returns the equivalent tokenstore
-   *         class defined in the metastore module which is
-   *         org.apache.hadoop.hive.metastore.security.MemoryTokenStore Similarly,
-   *         org.apache.hadoop.hive.thrift.DBTokenStore maps to
-   *         org.apache.hadoop.hive.metastore.security.DBTokenStore and
-   *         org.apache.hadoop.hive.thrift.ZooKeeperTokenStore maps to
-   *         org.apache.hadoop.hive.metastore.security.ZooKeeperTokenStore
-   */
-  public static String getTokenStoreClassName(Configuration conf) {
-    String tokenStoreClass = conf.get(DELEGATION_TOKEN_STORE_CLS, "");
-    if (StringUtils.isBlank(tokenStoreClass)) {
-      // default tokenstore is MemoryTokenStore
-      return MemoryTokenStore.class.getName();
-    }
-    switch (tokenStoreClass) {
-    case "org.apache.hadoop.hive.thrift.DBTokenStore":
-      return DBTokenStore.class.getName();
-    case "org.apache.hadoop.hive.thrift.MemoryTokenStore":
-      return MemoryTokenStore.class.getName();
-    case "org.apache.hadoop.hive.thrift.ZooKeeperTokenStore":
-      return ZooKeeperTokenStore.class.getName();
-    default:
-      return tokenStoreClass;
-    }
-  }
-
-
-  /**
-   * @return the user name set in hadoop.job.ugi param or the current user from System
-   * @throws IOException if underlying Hadoop call throws LoginException
-   */
-  public static String getUser() throws IOException {
-    try {
-      UserGroupInformation ugi = getUGI();
-      return ugi.getUserName();
-    } catch (LoginException le) {
-      throw new IOException(le);
-    }
-  }
-
-  public static TServerSocket getServerSocket(String hiveHost, int portNum) throws TTransportException {
-    InetSocketAddress serverAddress;
-    if (hiveHost == null || hiveHost.isEmpty()) {
-      // Wildcard bind
-      serverAddress = new InetSocketAddress(portNum);
-    } else {
-      serverAddress = new InetSocketAddress(hiveHost, portNum);
-    }
-    return new TServerSocket(serverAddress);
-  }
-
-  public static TServerSocket getServerSSLSocket(String hiveHost, int portNum, String keyStorePath,
-                                                 String keyStorePassWord, List<String> sslVersionBlacklist) throws TTransportException,
-      UnknownHostException {
-    TSSLTransportFactory.TSSLTransportParameters params =
-        new TSSLTransportFactory.TSSLTransportParameters();
-    params.setKeyStore(keyStorePath, keyStorePassWord);
-    InetSocketAddress serverAddress;
-    if (hiveHost == null || hiveHost.isEmpty()) {
-      // Wildcard bind
-      serverAddress = new InetSocketAddress(portNum);
-    } else {
-      serverAddress = new InetSocketAddress(hiveHost, portNum);
-    }
-    TServerSocket thriftServerSocket =
-        TSSLTransportFactory.getServerSocket(portNum, 0, serverAddress.getAddress(), params);
-    if (thriftServerSocket.getServerSocket() instanceof SSLServerSocket) {
-      List<String> sslVersionBlacklistLocal = new ArrayList<>();
-      for (String sslVersion : sslVersionBlacklist) {
-        sslVersionBlacklistLocal.add(sslVersion.trim().toLowerCase());
-      }
-      SSLServerSocket sslServerSocket = (SSLServerSocket) thriftServerSocket.getServerSocket();
-      List<String> enabledProtocols = new ArrayList<>();
-      for (String protocol : sslServerSocket.getEnabledProtocols()) {
-        if (sslVersionBlacklistLocal.contains(protocol.toLowerCase())) {
-          LOG.debug("Disabling SSL Protocol: " + protocol);
-        } else {
-          enabledProtocols.add(protocol);
-        }
-      }
-      sslServerSocket.setEnabledProtocols(enabledProtocols.toArray(new String[0]));
-      LOG.info("SSL Server Socket Enabled Protocols: "
-          + Arrays.toString(sslServerSocket.getEnabledProtocols()));
-    }
-    return thriftServerSocket;
-  }
-
-  public static TTransport getSSLSocket(String host, int port, int loginTimeout,
-                                        String trustStorePath, String trustStorePassWord) throws TTransportException {
-    TSSLTransportFactory.TSSLTransportParameters params =
-        new TSSLTransportFactory.TSSLTransportParameters();
-    params.setTrustStore(trustStorePath, trustStorePassWord);
-    params.requireClientAuth(true);
-    // The underlying SSLSocket object is bound to host:port with the given SO_TIMEOUT and
-    // SSLContext created with the given params
-    TSocket tSSLSocket = TSSLTransportFactory.getClientSocket(host, port, loginTimeout, params);
-    return getSSLSocketWithHttps(tSSLSocket);
-  }
-
-  // Using endpoint identification algorithm as HTTPS enables us to do
-  // CNAMEs/subjectAltName verification
-  private static TSocket getSSLSocketWithHttps(TSocket tSSLSocket) throws TTransportException {
-    SSLSocket sslSocket = (SSLSocket) tSSLSocket.getSocket();
-    SSLParameters sslParams = sslSocket.getSSLParameters();
-    sslParams.setEndpointIdentificationAlgorithm("HTTPS");
-    sslSocket.setSSLParameters(sslParams);
-    return new TSocket(sslSocket);
-  }
-}

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/StringableMap.java
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/StringableMap.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/StringableMap.java
deleted file mode 100644
index b3f1749..0000000
--- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/StringableMap.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.hive.metastore.utils;
-
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * A utility class that can convert a HashMap of Properties into a colon separated string,
- * and can take the same format of string and convert it to a HashMap of Properties.
- */
-public class StringableMap extends HashMap<String, String> {
-
-  public StringableMap(String s) {
-    String[] parts = s.split(":", 2);
-    // read that many chars
-    int numElements = Integer.parseInt(parts[0]);
-    s = parts[1];
-    for (int i = 0; i < numElements; i++) {
-      parts = s.split(":", 2);
-      int len = Integer.parseInt(parts[0]);
-      String key = null;
-      if (len > 0) key = parts[1].substring(0, len);
-      parts = parts[1].substring(len).split(":", 2);
-      len = Integer.parseInt(parts[0]);
-      String value = null;
-      if (len > 0) value = parts[1].substring(0, len);
-      s = parts[1].substring(len);
-      put(key, value);
-    }
-  }
-
-  public StringableMap(Map<String, String> m) {
-    super(m);
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder buf = new StringBuilder();
-    buf.append(size());
-    buf.append(':');
-    if (size() > 0) {
-      for (Map.Entry<String, String> entry : entrySet()) {
-        int length = (entry.getKey() == null) ? 0 : entry.getKey().length();
-        buf.append(entry.getKey() == null ? 0 : length);
-        buf.append(':');
-        if (length > 0) buf.append(entry.getKey());
-        length = (entry.getValue() == null) ? 0 : entry.getValue().length();
-        buf.append(length);
-        buf.append(':');
-        if (length > 0) buf.append(entry.getValue());
-      }
-    }
-    return buf.toString();
-  }
-
-  public Properties toProperties() {
-    Properties props = new Properties();
-    props.putAll(this);
-    return props;
-  }
-}

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/resources/package.jdo
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/resources/package.jdo b/standalone-metastore/metastore-common/src/main/resources/package.jdo
deleted file mode 100644
index 5fb548c..0000000
--- a/standalone-metastore/metastore-common/src/main/resources/package.jdo
+++ /dev/null
@@ -1,1420 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
- 
-      http://www.apache.org/licenses/LICENSE-2.0
- 
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---> 
-<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
-  "http://java.sun.com/dtd/jdo_2_0.dtd">
-<!--
-  Size Limitations:
-
-  Indexed VARCHAR: 767 bytes (MySQL running on InnoDB Engine http://bugs.mysql.com/bug.php?id=13315)
-  Non-indexed VARCHAR: 4000 bytes (max length on Oracle 9i/10g/11g)
-
--->
-<jdo>
-  <package name="org.apache.hadoop.hive.metastore.model">
-    <class name="MDatabase" identity-type="datastore" table="DBS" detachable="true">  
-      <datastore-identity>
-        <column name="DB_ID"/>
-      </datastore-identity>
-      <index name="UniqueDatabase" unique="true">
-        <column name="NAME"/>
-        <column name="CTLG_NAME"/>
-      </index>
-      <field name="name">  
-        <column name="NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="catalogName">
-        <column name="CTLG_NAME" length="256" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="description">
-        <column name="DESC" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="locationUri">
-        <column name="DB_LOCATION_URI" length="4000" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="parameters" table="DATABASE_PARAMS">
-        <map key-type="java.lang.String" value-type="java.lang.String"/>
-        <join>
-          <column name="DB_ID"/>
-        </join>
-        <key>
-           <column name="PARAM_KEY" length="180" jdbc-type="VARCHAR"/>
-        </key>
-        <value>
-           <column name="PARAM_VALUE" length="4000" jdbc-type="VARCHAR"/>
-        </value>
-      </field>
-      <field name="ownerName">    
-        <column name="OWNER_NAME" length="128" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-       <field name="ownerType">
-        <column name="OWNER_TYPE" length="10" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-    </class>
-
-    <class name="MCatalog" identity-type="datastore" table="CTLGS" detachable="true">
-      <datastore-identity>
-        <column name="CTLG_ID"/>
-      </datastore-identity>
-      <field name="name">
-        <column name="NAME" length="256" jdbc-type="VARCHAR"/>
-        <index name="UniqueCatalog" unique="true"/>
-      </field>
-      <field name="description">
-        <column name="DESC" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="locationUri">
-        <column name="LOCATION_URI" length="4000" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-    </class>
-
-    <class name="MFieldSchema" embedded-only="true" table="TYPE_FIELDS" detachable="true">
-      <field name="name">
-        <column name="FNAME" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="type" >
-        <column name="FTYPE" length="32672" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="comment" >
-        <column name="FCOMMENT" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-    </class>
-
-    <class name="MType" table="TYPES" detachable="true">  
-      <field name="name" >  
-        <column name="TYPE_NAME" length="128" jdbc-type="VARCHAR"/>  
-        <index name="UniqueType" unique="true"/>
-      </field>
-      <field name="type1">  
-        <column name="TYPE1" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="type2">  
-        <column name="TYPE2" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="fields" table="TYPE_FIELDS" >
-        <collection element-type="MFieldSchema"/>
-        <join>
-          <primary-key name="TYPE_FIELDS_PK">
-            <column name="TYPE_NAME"/>
-            <column name="FIELD_NAME"/>
-          </primary-key>
-          <column name="TYPE_NAME"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="name">
-              <column name="FIELD_NAME" length="128" jdbc-type="VARCHAR"/>
-            </field>
-            <field name="type">
-              <column name="FIELD_TYPE" length="767" jdbc-type="VARCHAR"  allows-null="false"/>
-            </field>
-            <field name="comment" >
-              <column name="COMMENT" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-            </field>
-          </embedded>
-        </element>
-      </field>
-    </class>
-
-    <class name="MTable" table="TBLS" identity-type="datastore" detachable="true">
-      <datastore-identity>
-        <column name="TBL_ID"/>
-      </datastore-identity>
-      <index name="UniqueTable" unique="true">
-        <column name="TBL_NAME"/>
-        <column name="DB_ID"/>
-      </index>
-      <field name="tableName">
-        <column name="TBL_NAME" length="256" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="database">
-        <column name="DB_ID"/>
-      </field>
-      <field name="partitionKeys" table="PARTITION_KEYS" >
-        <collection element-type="MFieldSchema"/>
-        <join>
-          <primary-key name="PARTITION_KEY_PK">
-            <column name="TBL_ID"/>
-            <column name="PKEY_NAME"/>
-          </primary-key>
-          <column name="TBL_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="name">
-              <column name="PKEY_NAME" length="128" jdbc-type="VARCHAR"/>
-              </field>
-            <field name="type">
-              <column name="PKEY_TYPE" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="comment" >
-              <column name="PKEY_COMMENT" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-            </field>
-          </embedded>
-        </element>
-      </field>
-      <field name="sd" dependent="true">
-        <column name="SD_ID"/>
-      </field>
-      <field name="owner">
-        <column name="OWNER" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="ownerType">
-        <column name="OWNER_TYPE" length="10" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="lastAccessTime">
-        <column name="LAST_ACCESS_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="retention">
-        <column name="RETENTION" jdbc-type="integer"/>
-      </field>
-      <field name="parameters" table="TABLE_PARAMS">
-        <map key-type="java.lang.String" value-type="java.lang.String"/>
-        <join>
-          <column name="TBL_ID"/>
-        </join>
-        <key>
-           <column name="PARAM_KEY" length="256" jdbc-type="VARCHAR"/>
-        </key>
-        <value>
-           <column name="PARAM_VALUE" length="32672" jdbc-type="VARCHAR"/>
-        </value>
-      </field>
-      <field name="viewOriginalText" default-fetch-group="false">
-        <column name="VIEW_ORIGINAL_TEXT" jdbc-type="LONGVARCHAR"/>
-      </field>
-      <field name="viewExpandedText" default-fetch-group="false">
-        <column name="VIEW_EXPANDED_TEXT" jdbc-type="LONGVARCHAR"/>
-      </field>
-      <field name="rewriteEnabled">
-        <column name="IS_REWRITE_ENABLED"/>
-      </field>
-      <field name="tableType">
-        <column name="TBL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MCreationMetadata" identity-type="datastore" table="MV_CREATION_METADATA" detachable="true">
-      <datastore-identity>
-        <column name="MV_CREATION_METADATA_ID"/>
-      </datastore-identity>
-      <field name="catalogName">
-        <column name="CAT_NAME" length="256" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="dbName">
-        <column name="DB_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="tblName">
-        <column name="TBL_NAME" length="256" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="tables" table="MV_TABLES_USED">
-        <collection element-type="MTable"/>
-        <join>
-          <column name="MV_CREATION_METADATA_ID"/>
-        </join>
-        <element column="TBL_ID"/>
-      </field>
-      <field name="txnList">
-        <column name="TXN_LIST" jdbc-type="CLOB" allows-null="true"/>
-      </field>
-    </class>
-
-    <class name="MConstraint" identity-type="application" table="KEY_CONSTRAINTS" detachable="true" objectid-class="MConstraint$PK">
-      <field name="constraintName" primary-key="true">
-        <column name="CONSTRAINT_NAME"/>
-      </field>
-      <field name="position" primary-key="true">
-        <column name="POSITION"/>
-      </field>
-      <field name="childColumn">
-        <column name="CHILD_CD_ID"/>
-      </field>
-      <field name="childIntegerIndex">
-        <column name="CHILD_INTEGER_IDX"/>
-      </field>
-      <field name="childTable">
-        <column name="CHILD_TBL_ID"/>
-      </field>
-      <field name="parentColumn">
-        <column name="PARENT_CD_ID"/>
-      </field>
-      <field name="parentIntegerIndex">
-    <column name="PARENT_INTEGER_IDX"/>
-      </field>
-      <field name="parentTable">
-        <column name="PARENT_TBL_ID"/>
-      </field>
-      <field name="constraintType">
-        <column name="CONSTRAINT_TYPE"/>
-      </field>
-      <field name="deleteRule">
-        <column name="DELETE_RULE"/>
-      </field>
-      <field name="updateRule">
-        <column name="UPDATE_RULE"/>
-      </field>
-      <field name="enableValidateRely">
-        <column name="ENABLE_VALIDATE_RELY"/>
-      </field>
-    </class>
-
-    <class name="MSerDeInfo" identity-type="datastore" table="SERDES" detachable="true">
-      <datastore-identity>
-        <column name="SERDE_ID"/>
-      </datastore-identity>
-      <field name="name">
-        <column name="NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="serializationLib">
-        <column name="SLIB" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="parameters" table="SERDE_PARAMS">
-        <map key-type="java.lang.String" value-type="java.lang.String"/>
-        <join>
-          <column name="SERDE_ID"/>
-        </join>
-        <key>
-           <column name="PARAM_KEY" length="256" jdbc-type="VARCHAR"/>
-        </key>
-        <value>
-           <column name="PARAM_VALUE" length="32672" jdbc-type="VARCHAR"/>
-        </value>
-      </field>
-      <field name="description">
-        <column name="DESCRIPTION" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="serializerClass">
-        <column name="SERIALIZER_CLASS" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="deserializerClass">
-        <column name="DESERIALIZER_CLASS" length="4000" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="serdeType">
-        <column name="SERDE_TYPE" jdbc-type="integer" allows-null="true"/>
-      </field>
-    </class>
-
-    <class name="MOrder" embedded-only="true" table="SORT_ORDER" detachable="true">
-      <field name="col">
-        <column name="COL_NAME" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="order">
-        <column name="ORDER" jdbc-type="INTEGER"  allows-null="false"/>
-      </field>
-    </class>
-
-    <class name="MColumnDescriptor" identity-type="datastore" table="CDS" detachable="true">
-      <datastore-identity>
-        <column name="CD_ID"/>
-      </datastore-identity>
-      <field name="cols" table="COLUMNS_V2" >
-        <collection element-type="MFieldSchema"/>
-        <join>
-          <primary-key name="COLUMNS_PK">
-            <column name="COLUMN_NAME"/>
-          </primary-key>
-          <column name="CD_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="name">
-              <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR"/>
-              </field>
-            <field name="type">
-              <column name="TYPE_NAME" length="32672" jdbc-type="VARCHAR" allows-null="false"/>
-            </field>
-            <field name="comment">
-              <column name="COMMENT" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-            </field>
-          </embedded>
-        </element>
-      </field>
-    </class>
-
-   <class name="MStringList" identity-type="datastore" table="Skewed_STRING_LIST" detachable="true">
-     <datastore-identity>
-       <column name="STRING_LIST_ID"/>
-     </datastore-identity>
-     <field name="internalList" table="Skewed_STRING_LIST_VALUES">
-       <collection element-type="java.lang.String"/>
-       <join>
-         <column name="STRING_LIST_ID"/>
-       </join>
-       <element column="STRING_LIST_VALUE"/>
-     </field>
-   </class>
-
-    <class name="MStorageDescriptor" identity-type="datastore" table="SDS" detachable="true">
-      <datastore-identity>
-        <column name="SD_ID"/>
-      </datastore-identity>
-      <field name="cd">
-          <column name="CD_ID"/>
-      </field>
-      <field name="location">
-        <column name="LOCATION" length="4000" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="inputFormat">
-        <column name="INPUT_FORMAT" length="4000" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="outputFormat">
-        <column name="OUTPUT_FORMAT" length="4000" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="isCompressed">
-        <column name="IS_COMPRESSED"/>
-      </field>
-      <field name="isStoredAsSubDirectories">
-        <column name="IS_STOREDASSUBDIRECTORIES"/>
-      </field>
-      <field name="numBuckets">
-        <column name="NUM_BUCKETS" jdbc-type="integer"/>
-      </field>
-      <field name="serDeInfo" dependent="true">
-        <column name="SERDE_ID"/>
-      </field>
-      <field name="bucketCols" table="BUCKETING_COLS">
-        <collection element-type="java.lang.String"/>
-        <join>
-          <column name="SD_ID"/>
-        </join>
-        <element column="BUCKET_COL_NAME"/>
-      </field>
-      <field name="sortCols" table="SORT_COLS">
-        <collection element-type="MOrder"/>
-        <join>
-          <column name="SD_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="col">
-              <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR"/>
-              </field>
-            <field name="order">
-              <column name="ORDER" jdbc-type="INTEGER"  allows-null="false"/>
-            </field>
-          </embedded>
-        </element>
-      </field>
-      <field name="parameters" table="SD_PARAMS">
-        <map key-type="java.lang.String" value-type="java.lang.String"/>
-        <join>
-          <column name="SD_ID"/>
-        </join>
-        <key>
-           <column name="PARAM_KEY" length="256" jdbc-type="VARCHAR"/>
-        </key>
-        <value>
-           <column name="PARAM_VALUE" length="32672" jdbc-type="VARCHAR"/>
-        </value>
-      </field>
-      <field name="skewedColNames" table="SKEWED_COL_NAMES">
-        <collection element-type="java.lang.String"/>
-        <join>
-          <column name="SD_ID"/>
-        </join>
-        <element column="SKEWED_COL_NAME"/>
-      </field>
-      <field name="skewedColValues" table="SKEWED_VALUES">
-        <collection element-type="MStringList"/>
-        <join/>
-      </field>
-      <field name="skewedColValueLocationMaps" table="SKEWED_COL_VALUE_LOC_MAP">
-        <map key-type="MStringList" value-type="java.lang.String"/>
-        <join>
-          <column name="SD_ID"/>
-        </join>
-        <value>
-          <column name="location" length="4000" jdbc-type="VARCHAR"/>
-        </value>
-      </field>
-    </class>
-
-    <class name="MPartition" table="PARTITIONS" identity-type="datastore" detachable="true">
-      <index name="UniquePartition" unique="true">
-        <column name="PART_NAME"/>
-        <column name="TBL_ID"/>
-      </index>
-      <datastore-identity>
-        <column name="PART_ID"/>
-      </datastore-identity>
-      <field name="partitionName">
-        <column name="PART_NAME" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="table">
-        <column name="TBL_ID"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="lastAccessTime">
-        <column name="LAST_ACCESS_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="values" table="PARTITION_KEY_VALS">
-        <collection element-type="java.lang.String"/>
-        <join>
-          <column name="PART_ID"/>
-        </join>
-        <element column="PART_KEY_VAL"/>
-      </field>
-      <field name="sd" dependent="true">
-        <column name="SD_ID"/>
-      </field>
-      <field name="parameters" table="PARTITION_PARAMS">
-        <map key-type="java.lang.String" value-type="java.lang.String"/>
-        <join>
-          <column name="PART_ID"/>
-        </join>
-        <key>
-           <column name="PARAM_KEY" length="256" jdbc-type="VARCHAR"/>
-        </key>
-        <value>
-           <column name="PARAM_VALUE" length="4000" jdbc-type="VARCHAR"/>
-        </value>
-      </field>
-    </class>
-    
-    <class name="MIndex" table="IDXS" identity-type="datastore" detachable="true">
-      <index name="UniqueINDEX" unique="true">
-        <column name="INDEX_NAME"/>
-        <column name="ORIG_TBL_ID"/>
-      </index>
-      
-      <datastore-identity>
-        <column name="INDEX_ID"/>
-      </datastore-identity>
-      <field name="indexName">
-        <column name="INDEX_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="origTable">
-        <column name="ORIG_TBL_ID"/>
-      </field>
-      <field name="indexTable">
-        <column name="INDEX_TBL_ID"/>
-      </field>
-      <field name="indexHandlerClass">
-        <column name="INDEX_HANDLER_CLASS" length="4000" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="deferredRebuild">
-        <column name="DEFERRED_REBUILD"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="lastAccessTime">
-        <column name="LAST_ACCESS_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="sd" dependent="true">
-        <column name="SD_ID"/>
-      </field>
-      <field name="parameters" table="INDEX_PARAMS">
-        <map key-type="java.lang.String" value-type="java.lang.String"/>
-        <join>
-          <column name="INDEX_ID"/>
-        </join>
-        <key>
-           <column name="PARAM_KEY" length="256" jdbc-type="VARCHAR"/>
-        </key>
-        <value>
-           <column name="PARAM_VALUE" length="4000" jdbc-type="VARCHAR"/>
-        </value>
-      </field>
-    </class>
-
-    <class name="MRole" table="ROLES" identity-type="datastore" detachable="true">
-
-      <index name="RoleEntityINDEX" unique="true">
-        <column name="ROLE_NAME"/>
-      </index>
-
-      <datastore-identity>
-        <column name="ROLE_ID"/>
-      </datastore-identity>
-
-      <field name="roleName">
-        <column name="ROLE_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="ownerName">
-        <column name="OWNER_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      
-    </class>
-
-    <class name="MRoleMap" table="ROLE_MAP" identity-type="datastore" detachable="true">
-      <index name="UserRoleMapINDEX" unique="true">
-        <column name="PRINCIPAL_NAME"/>
-        <column name="ROLE_ID"/>
-        <column name="GRANTOR"/>
-        <column name="GRANTOR_TYPE"/>
-      </index>
-
-      <datastore-identity>
-        <column name="ROLE_GRANT_ID"/>
-      </datastore-identity>
-
-      <field name="role">
-        <column name="ROLE_ID" />
-      </field>
-      <field name="principalName">
-        <column name="PRINCIPAL_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="principalType">
-        <column name="PRINCIPAL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="addTime">
-        <column name="ADD_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="grantor">
-        <column name="GRANTOR" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantorType">
-        <column name="GRANTOR_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantOption">
-        <column name="GRANT_OPTION" jdbc-type="SMALLINT"/>
-      </field>
-    </class>
-
-    <class name="MGlobalPrivilege" table="GLOBAL_PRIVS" identity-type="datastore" detachable="true">
-      
-      <index name="GlobalPrivilegeIndex" unique="true">
-        <column name="AUTHORIZER"/>
-        <column name="PRINCIPAL_NAME"/>
-        <column name="PRINCIPAL_TYPE"/>
-        <column name="USER_PRIV"/>
-        <column name="GRANTOR"/>
-        <column name="GRANTOR_TYPE"/>
-      </index>
-    
-      <datastore-identity>
-        <column name="USER_GRANT_ID"/>
-      </datastore-identity>
-
-      <field name="principalName">
-        <column name="PRINCIPAL_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="principalType">
-        <column name="PRINCIPAL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="privilege">
-        <column name="USER_PRIV" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="grantor">
-        <column name="GRANTOR" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantorType">
-        <column name="GRANTOR_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantOption">
-        <column name="GRANT_OPTION" jdbc-type="SMALLINT"/>
-      </field>
-      <field name="authorizer">
-        <column name="AUTHORIZER" length="128" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MDBPrivilege" table="DB_PRIVS" identity-type="datastore" detachable="true">
-      
-      <index name="DBPrivilegeIndex" unique="true">
-        <column name="AUTHORIZER"/>
-        <column name="DB_ID"/>
-        <column name="PRINCIPAL_NAME"/>
-        <column name="PRINCIPAL_TYPE"/>
-        <column name="DB_PRIV"/>
-        <column name="GRANTOR"/>
-        <column name="GRANTOR_TYPE"/>
-      </index>
-
-      <datastore-identity>
-        <column name="DB_GRANT_ID"/>
-      </datastore-identity>
-
-      <field name="principalName">
-        <column name="PRINCIPAL_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="principalType">
-        <column name="PRINCIPAL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="database">
-        <column name="DB_ID" />
-      </field>
-      <field name="privilege">
-        <column name="DB_PRIV" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="grantor">
-        <column name="GRANTOR" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantorType">
-        <column name="GRANTOR_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantOption">
-        <column name="GRANT_OPTION" jdbc-type="SMALLINT"/>
-      </field>
-      <field name="authorizer">
-        <column name="AUTHORIZER" length="128" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MTablePrivilege" table="TBL_PRIVS" identity-type="datastore" detachable="true">
-    
-      <index name="TablePrivilegeIndex" unique="false">
-        <column name="AUTHORIZER"/>
-        <column name="TBL_ID"/>
-        <column name="PRINCIPAL_NAME"/>
-        <column name="PRINCIPAL_TYPE"/>
-        <column name="TBL_PRIV"/>
-        <column name="GRANTOR"/>
-        <column name="GRANTOR_TYPE"/>
-      </index>
-
-      <datastore-identity>
-        <column name="TBL_GRANT_ID"/>
-      </datastore-identity>
-
-      <field name="principalName">
-        <column name="PRINCIPAL_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="principalType">
-        <column name="PRINCIPAL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="table">
-        <column name="TBL_ID"/>
-      </field>
-      <field name="privilege">
-        <column name="TBL_PRIV" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="grantor">
-        <column name="GRANTOR" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantorType">
-        <column name="GRANTOR_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantOption">
-        <column name="GRANT_OPTION" jdbc-type="SMALLINT"/>
-      </field>
-      <field name="authorizer">
-        <column name="AUTHORIZER" length="128" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MPartitionPrivilege" table="PART_PRIVS" identity-type="datastore" detachable="true">
-    
-      <index name="PartPrivilegeIndex" unique="false">
-        <column name="AUTHORIZER"/>
-        <column name="PART_ID"/>
-        <column name="PRINCIPAL_NAME"/>
-        <column name="PRINCIPAL_TYPE"/>
-        <column name="PART_PRIV"/>
-        <column name="GRANTOR"/>
-        <column name="GRANTOR_TYPE"/>
-      </index>
-
-      <datastore-identity>
-        <column name="PART_GRANT_ID"/>
-      </datastore-identity>
-
-      <field name="principalName">
-        <column name="PRINCIPAL_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="principalType">
-        <column name="PRINCIPAL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="partition">
-        <column name="PART_ID" />
-      </field>
-      <field name="privilege">
-        <column name="PART_PRIV" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="grantor">
-        <column name="GRANTOR" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantorType">
-        <column name="GRANTOR_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantOption">
-        <column name="GRANT_OPTION" jdbc-type="SMALLINT"/>
-      </field>
-      <field name="authorizer">
-        <column name="AUTHORIZER" length="128" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MTableColumnPrivilege" table="TBL_COL_PRIVS" identity-type="datastore" detachable="true">
-    
-     <index name="TableColumnPrivilegeIndex" unique="false">
-        <column name="AUTHORIZER"/>
-        <column name="TBL_ID"/>
-        <column name="COLUMN_NAME"/>
-        <column name="PRINCIPAL_NAME"/>
-        <column name="PRINCIPAL_TYPE"/>
-        <column name="TBL_COL_PRIV"/>
-        <column name="GRANTOR"/>
-        <column name="GRANTOR_TYPE"/>
-      </index>
-
-      <datastore-identity>
-        <column name="TBL_COLUMN_GRANT_ID"/>
-      </datastore-identity>
-
-      <field name="principalName">
-        <column name="PRINCIPAL_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="principalType">
-        <column name="PRINCIPAL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="table">
-        <column name="TBL_ID" />
-      </field>
-      <field name="columnName">
-        <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="privilege">
-        <column name="TBL_COL_PRIV" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="grantor">
-        <column name="GRANTOR" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantorType">
-        <column name="GRANTOR_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantOption">
-        <column name="GRANT_OPTION" jdbc-type="SMALLINT"/>
-      </field>
-      <field name="authorizer">
-        <column name="AUTHORIZER" length="128" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MPartitionColumnPrivilege" table="PART_COL_PRIVS" identity-type="datastore" detachable="true">
-    
-     <index name="PartitionColumnPrivilegeIndex" unique="false">
-        <column name="AUTHORIZER"/>
-        <column name="PART_ID"/>
-        <column name="COLUMN_NAME"/>
-        <column name="PRINCIPAL_NAME"/>
-        <column name="PRINCIPAL_TYPE"/>
-        <column name="PART_COL_PRIV"/>
-        <column name="GRANTOR"/>
-        <column name="GRANTOR_TYPE"/>
-      </index>
-
-      <datastore-identity>
-        <column name="PART_COLUMN_GRANT_ID"/>
-      </datastore-identity>
-
-      <field name="principalName">
-        <column name="PRINCIPAL_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="principalType">
-        <column name="PRINCIPAL_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="partition">
-        <column name="PART_ID" />
-      </field>
-      <field name="columnName">
-        <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="privilege">
-        <column name="PART_COL_PRIV" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="grantor">
-        <column name="GRANTOR" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantorType">
-        <column name="GRANTOR_TYPE" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="grantOption">
-        <column name="GRANT_OPTION" jdbc-type="SMALLINT"/>
-      </field>
-      <field name="authorizer">
-        <column name="AUTHORIZER" length="128" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MPartitionEvent"  table="PARTITION_EVENTS" identity-type="datastore" detachable="true">  
-       
-      <index name="PartitionEventIndex" unique="false">
-        <column name="PARTITION_NAME"/>
-      </index>
-      
-      <datastore-identity>
-        <column name="PART_NAME_ID"/>
-      </datastore-identity>
-      
-      <field name="catalogName">  
-        <column name="CAT_NAME" length="256" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="dbName">  
-        <column name="DB_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="tblName">
-        <column name="TBL_NAME" length="256" jdbc-type="VARCHAR"/>
-      </field>
-       <field name="partName">
-        <column name="PARTITION_NAME" length="767" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="eventType">
-        <column name="EVENT_TYPE"  jdbc-type="integer"/>
-      </field>
-     <field name="eventTime">
-        <column name="EVENT_TIME"  jdbc-type="BIGINT"/>
-      </field>
-
-    </class>
-    
-    <class name="MMasterKey" table="MASTER_KEYS" identity-type="application" detachable="true">
-
-      <field name="keyId" primary-key="true" value-strategy="native">
-        <column name="KEY_ID" jdbc-type="integer" />
-      </field>
-        
-      <field name="masterKey">
-        <column name="MASTER_KEY" length="767" jdbc-type="VARCHAR" />
-      </field>  
-      
-    </class>
-
-    <class name="MDelegationToken" table="DELEGATION_TOKENS" identity-type="application" detachable="true">
-
-      <field name="tokenIdentifier" primary-key="true">
-        <column name="TOKEN_IDENT" length="767" jdbc-type="VARCHAR" />
-      </field>  
-
-      <field name="tokenStr">
-        <column name="TOKEN" length="767" jdbc-type="VARCHAR" />
-      </field>
-            
-    </class>    
-
-    <class name="MTableColumnStatistics" table="TAB_COL_STATS" identity-type="datastore" detachable="true">
-      <datastore-identity>
-        <column name="CS_ID"/>
-      </datastore-identity>
-
-      <field name ="catName">
-        <column name="CAT_NAME" length="256" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name ="dbName">
-        <column name="DB_NAME" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="tableName">
-        <column name="TABLE_NAME" length="256" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="table">
-        <column name="TBL_ID"/>
-      </field>
-      <field name="colName">
-        <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="colType">
-        <column name="COLUMN_TYPE" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="longLowValue">
-        <column name="LONG_LOW_VALUE"  jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="longHighValue">
-        <column name="LONG_HIGH_VALUE" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-       <field name="doubleLowValue">
-        <column name="DOUBLE_LOW_VALUE"  jdbc-type="DOUBLE" allows-null="true"/>
-      </field>
-      <field name="doubleHighValue">
-        <column name="DOUBLE_HIGH_VALUE" jdbc-type="DOUBLE" allows-null="true"/>
-      </field>
-      <field name="decimalLowValue">
-        <column name="BIG_DECIMAL_LOW_VALUE"  jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="decimalHighValue">
-        <column name="BIG_DECIMAL_HIGH_VALUE" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="numNulls">
-        <column name="NUM_NULLS" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-      <field name="numDVs">
-        <column name="NUM_DISTINCTS" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="bitVector">
-        <column name="BIT_VECTOR" jdbc-type="BLOB" allows-null="true"/>
-      </field>
-      <field name="avgColLen">
-        <column name="AVG_COL_LEN" jdbc-type="DOUBLE" allows-null="true"/>
-      </field>
-      <field name="maxColLen">
-        <column name="MAX_COL_LEN" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="numTrues">
-        <column name="NUM_TRUES" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="numFalses">
-        <column name="NUM_FALSES" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="lastAnalyzed">
-        <column name="LAST_ANALYZED" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-    </class>
-
-    <class name="MPartitionColumnStatistics" table="PART_COL_STATS" identity-type="datastore" detachable="true">
-      <datastore-identity>
-        <column name="CS_ID"/>
-      </datastore-identity>
-
-      <field name ="catName">
-        <column name="CAT_NAME" length="256" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name ="dbName">
-        <column name="DB_NAME" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="tableName">
-        <column name="TABLE_NAME" length="256" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="partitionName">
-        <column name="PARTITION_NAME" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="partition">
-        <column name="PART_ID"/>
-      </field>
-      <field name="colName">
-        <column name="COLUMN_NAME" length="767" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="colType">
-        <column name="COLUMN_TYPE" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="longLowValue">
-        <column name="LONG_LOW_VALUE"  jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="longHighValue">
-        <column name="LONG_HIGH_VALUE" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-       <field name="doubleLowValue">
-        <column name="DOUBLE_LOW_VALUE"  jdbc-type="DOUBLE" allows-null="true"/>
-      </field>
-      <field name="doubleHighValue">
-        <column name="DOUBLE_HIGH_VALUE" jdbc-type="DOUBLE" allows-null="true"/>
-      </field>
-      <field name="decimalLowValue">
-        <column name="BIG_DECIMAL_LOW_VALUE"  jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="decimalHighValue">
-        <column name="BIG_DECIMAL_HIGH_VALUE" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="numNulls">
-        <column name="NUM_NULLS" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-      <field name="numDVs">
-        <column name="NUM_DISTINCTS" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="bitVector">
-        <column name="BIT_VECTOR" jdbc-type="BLOB" allows-null="true"/>
-      </field>
-      <field name="avgColLen">
-        <column name="AVG_COL_LEN" jdbc-type="DOUBLE" allows-null="true"/>
-      </field>
-      <field name="maxColLen">
-        <column name="MAX_COL_LEN" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="numTrues">
-        <column name="NUM_TRUES" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="numFalses">
-        <column name="NUM_FALSES" jdbc-type="BIGINT" allows-null="true"/>
-      </field>
-      <field name="lastAnalyzed">
-        <column name="LAST_ANALYZED" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-    </class>
-    <class name="MVersionTable" table="VERSION" identity-type="datastore" detachable="true">
-      <datastore-identity>
-        <column name="VER_ID"/>
-      </datastore-identity>
-      <field name ="schemaVersion">
-        <column name="SCHEMA_VERSION" length="127" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name ="versionComment">
-        <column name="VERSION_COMMENT" length="255" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-    </class>
-
-    <class name="MMetastoreDBProperties" table="METASTORE_DB_PROPERTIES" identity-type="application" detachable="true">
-      <field name ="propertyKey" primary-key="true">
-        <column name="PROPERTY_KEY" length="255" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name ="propertyValue">
-        <column name="PROPERTY_VALUE" length="1000" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name ="description">
-        <column name="DESCRIPTION" length="1000" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-    </class>
-
-    <class name="MResourceUri" embedded-only="true" table="RESOURCE_URI" detachable="true">
-      <field name="resourceType">
-        <column name="RESOURCE_TYPE" jdbc-type="INTEGER"/>
-      </field>
-      <field name="uri">
-        <column name="RESOURCE_URI" length="4000" jdbc-type="VARCHAR"/>
-      </field>
-    </class>
-
-    <class name="MFunction" table="FUNCS" identity-type="datastore" detachable="true">
-      <datastore-identity>
-        <column name="FUNC_ID"/>
-      </datastore-identity>
-      <index name="UniqueFunction" unique="true">
-        <column name="FUNC_NAME"/>
-        <column name="DB_ID"/>
-      </index>
-      <field name="functionName">
-        <column name="FUNC_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="database">
-        <column name="DB_ID"/>
-      </field>
-      <field name="functionType">
-        <column name="FUNC_TYPE" jdbc-type="integer"/>
-      </field>
-      <field name="className">
-        <column name="CLASS_NAME" length="4000" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="ownerName">    
-        <column name="OWNER_NAME" length="128" jdbc-type="VARCHAR"/>
-      </field>
-       <field name="ownerType">
-        <column name="OWNER_TYPE" length="10" jdbc-type="VARCHAR"/>
-      </field>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="resourceUris" table="FUNC_RU">
-        <collection element-type="MResourceUri"/>
-        <join>
-          <column name="FUNC_ID"/>
-        </join>
-        <element>
-          <embedded>
-            <field name="resourceType">
-              <column name="RESOURCE_TYPE" jdbc-type="INTEGER"/>
-            </field>
-            <field name="uri">
-              <column name="RESOURCE_URI" length="4000" jdbc-type="VARCHAR"/>
-            </field>
-          </embedded>
-        </element>
-      </field>
-    </class>
-
-    <class name="MNotificationLog" table="NOTIFICATION_LOG" identity-type="datastore" detachable="true">
-      <datastore-identity strategy="increment"/>
-      <datastore-identity key-cache-size="1"/>
-      <datastore-identity>
-        <column name="NL_ID"/>
-      </datastore-identity>
-      <field name="eventId">
-        <column name="EVENT_ID" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-      <field name="eventTime">
-        <column name="EVENT_TIME" jdbc-type="INTEGER" allows-null="false"/>
-      </field>
-      <field name="eventType">
-        <column name="EVENT_TYPE" length="32" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="catalogName">
-        <column name="CAT_NAME" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="dbName">
-        <column name="DB_NAME" length="128" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="tableName">
-        <column name="TBL_NAME" length="256" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-      <field name="message">
-        <column name="MESSAGE" jdbc-type="LONGVARCHAR"/>
-      </field>
-      <field name="messageFormat">
-        <column name="MESSAGE_FORMAT" length="16" jdbc-type="VARCHAR" allows-null="true"/>
-      </field>
-    </class>
-
-    <!-- I tried to use a sequence here but derby didn't handle it well. -->
-    <class name="MNotificationNextId" table="NOTIFICATION_SEQUENCE" identity-type="datastore" detachable="true">
-      <datastore-identity>
-        <column name="NNI_ID"/>
-      </datastore-identity>
-      <field name="nextEventId">
-        <column name="NEXT_EVENT_ID" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-    </class>
-
-    <class name="MTxnWriteNotificationLog" table="TXN_WRITE_NOTIFICATION_LOG" identity-type="datastore" detachable="true">
-      <datastore-identity strategy="increment"/>
-      <datastore-identity key-cache-size="1"/>
-      <datastore-identity>
-        <column name="WNL_ID"/>
-      </datastore-identity>
-      <field name="txnId">
-        <column name="WNL_TXNID" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-      <field name="writeId">
-        <column name="WNL_WRITEID" jdbc-type="BIGINT" allows-null="false"/>
-      </field>
-      <field name="database">
-        <column name="WNL_DATABASE" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="table">
-        <column name="WNL_TABLE" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="partition">
-        <column name="WNL_PARTITION" length="1024" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="tableObject">
-        <column name="WNL_TABLE_OBJ" jdbc-type="LONGVARCHAR"/>
-      </field>
-      <field name="partObject">
-        <column name="WNL_PARTITION_OBJ" jdbc-type="LONGVARCHAR"/>
-      </field>
-      <field name="files">
-        <column name="WNL_FILES" jdbc-type="LONGVARCHAR"/>
-      </field>
-      <field name="eventTime">
-        <column name="WNL_EVENT_TIME" jdbc-type="INTEGER" allows-null="false"/>
-      </field>
-    </class>
-
-    <class name="MWMResourcePlan" identity-type="datastore" table="WM_RESOURCEPLAN" detachable="true">
-      <datastore-identity>
-        <column name="RP_ID"/>
-      </datastore-identity>
-      <field name="name">
-        <column name="NAME" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="queryParallelism">
-        <column name="QUERY_PARALLELISM" jdbc-type="integer" allows-null="true"/>
-      </field>
-      <field name="status">
-        <column name="STATUS" jdbc-type="string" allows-null="false"/>
-      </field>
-      <field name="defaultPool">
-        <column name="DEFAULT_POOL_ID" jdbc-type="integer" allows-null="true"/>
-      </field>
-      <index name="UniqueResourcePlan" unique="true">
-        <column name="NAME"/>
-      </index>
-
-      <field name="pools" mapped-by="resourcePlan">
-        <collection element-type="MWMPool"/>
-      </field>
-      <field name="triggers" mapped-by="resourcePlan">
-        <collection element-type="MWMTrigger"/>
-      </field>
-      <field name="mappings" mapped-by="resourcePlan">
-        <collection element-type="MWMMapping"/>
-      </field>
-    </class>
-
-    <class name="MWMPool" identity-type="datastore" table="WM_POOL" detachable="true">
-      <datastore-identity>
-        <column name="POOL_ID"/>
-      </datastore-identity>
-      <field name="resourcePlan">
-        <column name="RP_ID" jdbc-type="integer" allows-null="false"/>
-      </field>
-      <field name="path">
-        <column name="PATH" length="1024" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="allocFraction">
-        <column name="ALLOC_FRACTION" jdbc-type="double" allows-null="true"/>
-      </field>
-      <field name="queryParallelism">
-        <column name="QUERY_PARALLELISM" jdbc-type="integer" allows-null="true"/>
-      </field>
-      <field name="schedulingPolicy">
-        <column name="SCHEDULING_POLICY" jdbc-type="string" allows-null="true"/>
-      </field>
-      <field name="triggers" table="WM_POOL_TO_TRIGGER">
-        <collection element-type="MWMTrigger" />
-        <join>
-          <column name="POOL_ID" />
-        </join>
-        <element>
-          <column name="TRIGGER_ID"/>
-        </element>
-      </field>
-      <index name="UniqueWMPool" unique="true">
-        <column name="RP_ID"/>
-        <column name="PATH"/>
-      </index>
-    </class>
-
-    <class name="MWMTrigger" identity-type="datastore" table="WM_TRIGGER" detachable="true">
-      <datastore-identity>
-        <column name="TRIGGER_ID"/>
-      </datastore-identity>
-      <field name="resourcePlan">
-        <column name="RP_ID" jdbc-type="integer" allows-null="false"/>
-      </field>
-      <field name="name">
-        <column name="NAME" length="128" jdbc-type="VARCHAR" allows-null="false"/>
-      </field>
-      <field name="triggerExpression">
-        <column name="TRIGGER_EXPRESSION" jdbc-type="string" allows-null="true"/>
-      </field>
-      <field name="actionExpression">
-        <column name="ACTION_EXPRESSION" jdbc-type="string" allows-null="true"/>
-      </field>
-      <field name="isInUnmanaged">
-        <column name="IS_IN_UNMANAGED" allows-null="false"/>
-      </field>
-      <field name="pools" mapped-by="triggers">
-        <collection element-type="MWMPool" />
-      </field>
-      <index name="UniqueWMTrigger" unique="true">
-        <column name="RP_ID"/>
-        <column name="NAME"/>
-      </index>
-    </class>
-
-    <class name="MWMMapping" identity-type="datastore" table="WM_MAPPING" detachable="true">
-      <datastore-identity>
-        <column name="MAPPING_ID"/>
-      </datastore-identity>
-      <field name="resourcePlan">
-        <column name="RP_ID" jdbc-type="integer" allows-null="false"/>
-      </field>
-      <field name="entityType">
-        <column name="ENTITY_TYPE" jdbc-type="string" length="128" />
-      </field>
-      <field name="entityName">
-        <column name="ENTITY_NAME" jdbc-type="string" length="128" />
-      </field>
-      <field name="pool">
-        <column name="POOL_ID" jdbc-type="integer" allows-null="true"/>
-      </field>
-      <field name="ordering">
-        <column name="ORDERING" jdbc-type="integer" allows-null="true"/>
-      </field>
-      <index name="UniqueWMMapping" unique="true">
-        <column name="RP_ID"/>
-        <column name="ENTITY_TYPE"/>
-        <column name="ENTITY_NAME"/>
-      </index>
-    </class>
-
-    <class name="MISchema" identity-type="datastore" table="I_SCHEMA" detachable="true">
-      <datastore-identity>
-        <column name="SCHEMA_ID"/>
-      </datastore-identity>
-      <field name="schemaType">
-        <column name="SCHEMA_TYPE" jdbc-type="integer"/>
-      </field>
-      <field name="name">
-        <column name="NAME" jdbc-type="varchar" length="256"/>
-      </field>
-      <field name="db">
-        <column name="DB_ID"/>
-      </field>
-      <field name="compatibility">
-        <column name="COMPATIBILITY" jdbc-type="integer"/>
-      </field>
-      <field name="validationLevel">
-        <column name="VALIDATION_LEVEL" jdbc-type="integer"/>
-      </field>
-      <field name="canEvolve">
-        <column name="CAN_EVOLVE"/>
-      </field>
-      <field name="schemaGroup">
-        <column name="SCHEMA_GROUP" jdbc-type="varchar" length="256" allows-null="true"/>
-      </field>
-      <field name="description">
-        <column name="DESCRIPTION" jdbc-type="varchar" length="4000" allows-null="true"/>
-      </field>
-    </class>
-
-    <class name="MSchemaVersion" identity-type="datastore" table="SCHEMA_VERSION" detachable="true">
-      <datastore-identity>
-        <column name="SCHEMA_VERSION_ID"/>
-      </datastore-identity>
-      <field name="iSchema">
-        <column name="SCHEMA_ID"/>
-      </field>
-      <field name="version">
-        <column name="VERSION" jdbc-type="integer"/>
-      </field>
-      <field name="createdAt">
-        <column name="CREATED_AT" jdbc-type="bigint"/>
-      </field>
-      <field name="cols">
-          <column name="CD_ID"/>
-      </field>
-      <field name="state">
-        <column name="STATE" jdbc-type="integer"/>
-      </field>
-      <field name="description">
-        <column name="DESCRIPTION" jdbc-type="varchar" length="4000" allows-null="true"/>
-      </field>
-      <field name="schemaText" default-fetch-group="false">
-        <column name="SCHEMA_TEXT" jdbc-type="LONGVARCHAR"/>
-      </field>
-      <field name="fingerprint">
-        <column name="FINGERPRINT" jdbc-type="varchar" length="256" allows-null="true"/>
-      </field>
-      <field name="name">
-        <column name="SCHEMA_VERSION_NAME" jdbc-type="varchar" length="256" allows-null="true"/>
-      </field>
-      <field name="serDe">
-        <column name="SERDE_ID"/>
-      </field>
-    </class>
-    <class name="MRuntimeStat" identity-type="datastore" table="RUNTIME_STATS" detachable="true">
-      <datastore-identity>
-        <column name="RS_ID"/>
-      </datastore-identity>
-      <field name="createTime">
-        <column name="CREATE_TIME" jdbc-type="integer"/>
-      </field>
-      <field name="weight">
-        <column name="WEIGHT" jdbc-type="integer"/>
-      </field>
-      <field name="payload">
-        <column name="PAYLOAD" jdbc-type="BLOB" allows-null="true"/>
-      </field>
-   </class>
-  </package>
-</jdo>
-

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/scripts/base
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/scripts/base b/standalone-metastore/metastore-common/src/main/scripts/base
deleted file mode 100755
index c455b2a..0000000
--- a/standalone-metastore/metastore-common/src/main/scripts/base
+++ /dev/null
@@ -1,231 +0,0 @@
-#!/usr/bin/env bash
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-cygwin=false
-case "`uname`" in
-   CYGWIN*) cygwin=true;;
-esac
-
-bin=`dirname "$0"`
-# The strange redirect on cd is because on some systems cd outputs the directory you changed to
-bin=`cd "$bin" 2>&1 > /dev/null; pwd`
-
-. "$bin"/metastore-config.sh
-
-SERVICE=""
-HELP=""
-SKIP_HADOOPVERSION=false
-
-SERVICE_ARGS=()
-while [ $# -gt 0 ]; do
-  case "$1" in
-    --version)
-      shift
-      SERVICE=version
-      ;;
-    --service)
-      shift
-      SERVICE=$1
-      shift
-      ;;
-    --skiphadoopversion)
-      SKIP_HADOOPVERSION=true
-      shift
-      ;;
-    --help)
-      HELP=_help
-      shift
-      ;;
-    --debug*)
-      DEBUG=$1
-      shift
-      ;;
-    *)
-      SERVICE_ARGS=("${SERVICE_ARGS[@]}" "$1")
-      shift
-      ;;
-  esac
-done
-
-if [ "$SERVICE" = "" ] ; then
-  if [ "$HELP" = "_help" ] ; then
-    SERVICE="help"
-  else
-    SERVICE="cli"
-  fi
-fi
-
-if [[ "$SERVICE" =~ ^(help|schemaTool)$ ]] ; then
-  SKIP_HADOOPVERSION=true
-fi
-
-if [ -f "${METASTORE_CONF_DIR}/metastore-env.sh" ]; then
-  . "${METASTORE_CONF_DIR}/metastore-env.sh"
-fi
-
-CLASSPATH="${METASTORE_CONF_DIR}"
-
-METASTORE_LIB=${METASTORE_HOME}/lib
-
-# needed for execution
-if [ ! -f ${METASTORE_LIB}/hive-standalone-metastore-common-*.jar ]; then
-  echo "Missing Standalone MetaStore Jar"
-  exit 2;
-fi
-
-for f in ${METASTORE_LIB}/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
-# add the auxillary jars such as serdes
-if [ -d "${METASTORE_AUX_JARS_PATH}" ]; then
-  hive_aux_jars_abspath=`cd ${METASTORE_AUX_JARS_PATH} 2>&1 > /dev/null && pwd`
-  for f in $hive_aux_jars_abspath/*.jar; do
-    if [[ ! -f $f ]]; then
-        continue;
-    fi
-    if $cygwin; then
-	f=`cygpath -w "$f"`
-    fi
-    AUX_CLASSPATH=${AUX_CLASSPATH}:$f
-    if [ "${AUX_PARAM}" == "" ]; then
-        AUX_PARAM=file://$f
-    else
-        AUX_PARAM=${AUX_PARAM},file://$f;
-    fi
-  done
-elif [ "${METASTORE_AUX_JARS_PATH}" != "" ]; then 
-  METASTORE_AUX_JARS_PATH=`echo $METASTORE_AUX_JARS_PATH | sed 's/,/:/g'`
-  if $cygwin; then
-      METASTORE_AUX_JARS_PATH=`cygpath -p -w "$METASTORE_AUX_JARS_PATH"`
-      METASTORE_AUX_JARS_PATH=`echo $METASTORE_AUX_JARS_PATH | sed 's/;/,/g'`
-  fi
-  AUX_CLASSPATH=${AUX_CLASSPATH}:${METASTORE_AUX_JARS_PATH}
-  AUX_PARAM="file://$(echo ${METASTORE_AUX_JARS_PATH} | sed 's/:/,file:\/\//g')"
-fi
-
-if $cygwin; then
-    CLASSPATH=`cygpath -p -w "$CLASSPATH"`
-    CLASSPATH=${CLASSPATH};${AUX_CLASSPATH}
-else
-    CLASSPATH=${CLASSPATH}:${AUX_CLASSPATH}
-fi
-
-# supress the HADOOP_HOME warnings in 1.x.x
-export HADOOP_HOME_WARN_SUPPRESS=true 
-
-# to make sure log4j2.x and jline jars are loaded ahead of the jars pulled by hadoop
-export HADOOP_USER_CLASSPATH_FIRST=true
-
-# pass classpath to hadoop
-if [ "$HADOOP_CLASSPATH" != "" ]; then
-  export HADOOP_CLASSPATH="${CLASSPATH}:${HADOOP_CLASSPATH}"
-else
-  export HADOOP_CLASSPATH="$CLASSPATH"
-fi
-
-# also pass hive classpath to hadoop
-if [ "$METASTORE_CLASSPATH" != "" ]; then
-  export HADOOP_CLASSPATH="${HADOOP_CLASSPATH}:${METASTORE_CLASSPATH}";
-fi
-
-# check for hadoop in the path
-HADOOP_IN_PATH=`which hadoop 2>/dev/null`
-if [ -f ${HADOOP_IN_PATH} ]; then
-  HADOOP_DIR=`dirname "$HADOOP_IN_PATH"`/..
-fi
-# HADOOP_HOME env variable overrides hadoop in the path
-HADOOP_HOME=${HADOOP_HOME:-${HADOOP_PREFIX:-$HADOOP_DIR}}
-if [ "$HADOOP_HOME" == "" ]; then
-  echo "Cannot find hadoop installation: \$HADOOP_HOME or \$HADOOP_PREFIX must be set or hadoop must be in the path";
-  exit 4;
-fi
-
-HADOOP=$HADOOP_HOME/bin/hadoop
-if [ ! -f ${HADOOP} ]; then
-  echo "Cannot find hadoop installation: \$HADOOP_HOME or \$HADOOP_PREFIX must be set or hadoop must be in the path";
-  exit 4;
-fi
-
-if [ "$SKIP_HADOOPVERSION" = false ]; then
-  # Make sure we're using a compatible version of Hadoop
-  if [ "x$HADOOP_VERSION" == "x" ]; then
-      HADOOP_VERSION=$($HADOOP version 2>&2 | awk -F"\t" '/Hadoop/ {print $0}' | cut -d' ' -f 2);
-  fi
-  
-  # Save the regex to a var to workaround quoting incompatabilities
-  # between Bash 3.1 and 3.2
-  hadoop_version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$"
-  
-  if [[ "$HADOOP_VERSION" =~ $hadoop_version_re ]]; then
-      hadoop_major_ver=${BASH_REMATCH[1]}
-      hadoop_minor_ver=${BASH_REMATCH[2]}
-      hadoop_patch_ver=${BASH_REMATCH[4]}
-  else
-      echo "Unable to determine Hadoop version information."
-      echo "'hadoop version' returned:"
-      echo `$HADOOP version`
-      exit 5
-  fi
-  
-  if [ "$hadoop_major_ver" -lt "2" ] || [ "$hadoop_major_ver" -eq "2" -a "$hadoop_minor_ver" -lt "6" ]; then
-      echo "Standalone metastore requires Hadoop 2.6 or later."
-      echo "'hadoop version' returned:"
-      echo `$HADOOP version`
-      exit 6
-  fi
-fi
-
-if [ "${AUX_PARAM}" != "" ]; then
-  METASTORE_OPTS="$METASTORE_OPTS --hiveconf hive.aux.jars.path=${AUX_PARAM}"
-  AUX_JARS_CMD_LINE="-libjars ${AUX_PARAM}"
-fi
-
-SERVICE_LIST=""
-
-for i in "$bin"/ext/*.sh ; do
-  . $i
-done
-
-if [ "$DEBUG" ]; then
-  if [ "$HELP" ]; then
-    debug_help
-    exit 0
-  else
-    get_debug_params "$DEBUG"
-    export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS $METASTORE_MAIN_CLIENT_DEBUG_OPTS"
-  fi
-fi
-
-TORUN=""
-for j in $SERVICE_LIST ; do
-  if [ "$j" = "$SERVICE" ] ; then
-    TORUN=${j}$HELP
-  fi
-done
-
-# to initialize logging for all services
-export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=metastore-log4j2.properties"
-
-if [ "$TORUN" = "" ] ; then
-  echo "Service $SERVICE not found"
-  echo "Available Services: $SERVICE_LIST"
-  exit 7
-else
-  set -- "${SERVICE_ARGS[@]}"
-  $TORUN "$@"
-fi

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/scripts/ext/metastore.sh
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/scripts/ext/metastore.sh b/standalone-metastore/metastore-common/src/main/scripts/ext/metastore.sh
deleted file mode 100644
index a8d4d80..0000000
--- a/standalone-metastore/metastore-common/src/main/scripts/ext/metastore.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-THISSERVICE=metastore
-export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "
-
-metastore() {
-  echo "$(timestamp): Starting Metastore Server"
-  CLASS=org.apache.hadoop.hive.metastore.HiveMetaStore
-  if $cygwin; then
-    METASTORE_LIB=`cygpath -w "$METASTORE_LIB"`
-  fi
-  JAR=${METASTORE_LIB}/hive-standalone-metastore-common-*.jar
-
-  # hadoop 20 or newer - skip the aux_jars option and hiveconf
-
-  export HADOOP_CLIENT_OPTS=" -Dproc_metastore $HADOOP_CLIENT_OPTS "
-  export HADOOP_OPTS="$METASTORE_HADOOP_OPTS $HADOOP_OPTS"
-  exec $HADOOP jar $JAR $CLASS "$@"
-}
-
-metastore_help() {
-  metastore -h
-}
-
-timestamp()
-{
- date +"%Y-%m-%d %T"
-}

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/scripts/ext/schemaTool.sh
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/scripts/ext/schemaTool.sh b/standalone-metastore/metastore-common/src/main/scripts/ext/schemaTool.sh
deleted file mode 100644
index 1863b06..0000000
--- a/standalone-metastore/metastore-common/src/main/scripts/ext/schemaTool.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-THISSERVICE=schemaTool
-export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "
-
-schemaTool() {
-  METASTORE_OPTS=''
-  CLASS=org.apache.hadoop.hive.metastore.tools.MetastoreSchemaTool
-  if $cygwin; then
-    METASTORE_LIB=`cygpath -w "$METASTORE_LIB"`
-  fi
-  JAR=${METASTORE_LIB}/hive-standalone-metastore-common-*.jar
-
-  # hadoop 20 or newer - skip the aux_jars option and hiveconf
-  exec $HADOOP jar $JAR $CLASS "$@"
-}
-
-schemaTool_help () {
-  schemaTool -h
-}

http://git-wip-us.apache.org/repos/asf/hive/blob/081fa368/standalone-metastore/metastore-common/src/main/scripts/ext/smokeTest.sh
----------------------------------------------------------------------
diff --git a/standalone-metastore/metastore-common/src/main/scripts/ext/smokeTest.sh b/standalone-metastore/metastore-common/src/main/scripts/ext/smokeTest.sh
deleted file mode 100644
index cd1eb1d..0000000
--- a/standalone-metastore/metastore-common/src/main/scripts/ext/smokeTest.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-THISSERVICE=smokeTest
-export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "
-
-smokeTest() {
-  METASTORE_OPTS=''
-  CLASS=org.apache.hadoop.hive.metastore.tools.SmokeTest
-  if $cygwin; then
-    METASTORE_LIB=`cygpath -w "$METASTORE_LIB"`
-  fi
-  JAR=${METASTORE_LIB}/hive-standalone-metastore-common-*.jar
-
-  # hadoop 20 or newer - skip the aux_jars option and hiveconf
-  exec $HADOOP jar $JAR $CLASS "$@"
-}
-
-smokeTest_help () {
-  echo "There is no help, just run it"
-}