Repository: hive
Updated Branches:
  refs/heads/master 9373a6434 -> 98ec28eda


http://git-wip-us.apache.org/repos/asf/hive/blob/98ec28ed/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnPrivilege.java
----------------------------------------------------------------------
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnPrivilege.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnPrivilege.java
new file mode 100644
index 0000000..e3ce12c
--- /dev/null
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnPrivilege.java
@@ -0,0 +1,160 @@
+/**
+ * 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.model;
+
+public class MTableColumnPrivilege {
+
+  private String principalName;
+
+  private String principalType;
+
+  private MTable table;
+
+  private String columnName;
+
+  private String privilege;
+
+  private int createTime;
+
+  private String grantor;
+
+  private String grantorType;
+
+  private boolean grantOption;
+
+  public MTableColumnPrivilege() {
+  }
+
+  /**
+   * @param principalName
+   * @param principalType
+   * @param table
+   * @param columnName
+   * @param privileges
+   * @param createTime
+   * @param grantor
+   * @param grantorType
+   * @param grantOption
+   */
+  public MTableColumnPrivilege(String principalName, String principalType,
+      MTable table, String columnName, String privileges, int createTime,
+      String grantor, String grantorType, boolean grantOption) {
+    super();
+    this.principalName = principalName;
+    this.principalType = principalType;
+    this.table = table;
+    this.columnName = columnName;
+    this.privilege = privileges;
+    this.createTime = createTime;
+    this.grantor = grantor;
+    this.grantorType = grantorType;
+    this.grantOption = grantOption;
+  }
+
+  /**
+   * @return column name
+   */
+  public String getColumnName() {
+    return columnName;
+  }
+
+  /**
+   * @param columnName column name
+   */
+  public void setColumnName(String columnName) {
+    this.columnName = columnName;
+  }
+
+  /**
+   * @return a set of privileges this user/role/group has
+   */
+  public String getPrivilege() {
+    return privilege;
+  }
+
+  /**
+   * @param dbPrivileges a set of privileges this user/role/group has
+   */
+  public void setPrivilege(String dbPrivileges) {
+    this.privilege = dbPrivileges;
+  }
+
+  /**
+   * @return create time
+   */
+  public int getCreateTime() {
+    return createTime;
+  }
+
+  /**
+   * @param createTime create time
+   */
+  public void setCreateTime(int createTime) {
+    this.createTime = createTime;
+  }
+
+  public String getPrincipalName() {
+    return principalName;
+  }
+
+  public void setPrincipalName(String principalName) {
+    this.principalName = principalName;
+  }
+
+  public MTable getTable() {
+    return table;
+  }
+
+  public void setTable(MTable table) {
+    this.table = table;
+  }
+
+  public String getGrantor() {
+    return grantor;
+  }
+
+  public void setGrantor(String grantor) {
+    this.grantor = grantor;
+  }
+
+  public String getGrantorType() {
+    return grantorType;
+  }
+
+  public void setGrantorType(String grantorType) {
+    this.grantorType = grantorType;
+  }
+
+  public boolean getGrantOption() {
+    return grantOption;
+  }
+
+  public void setGrantOption(boolean grantOption) {
+    this.grantOption = grantOption;
+  }
+
+  public String getPrincipalType() {
+    return principalType;
+  }
+
+  public void setPrincipalType(String principalType) {
+    this.principalType = principalType;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/98ec28ed/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java
----------------------------------------------------------------------
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java
new file mode 100644
index 0000000..6cfaca3
--- /dev/null
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTableColumnStatistics.java
@@ -0,0 +1,263 @@
+/**
+ * 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.model;
+
+
+
+/**
+ *
+ * MTableColumnStatistics - Represents Hive's Column Statistics Description. 
The fields in this
+ * class with the exception of table are persisted in the metastore. In case 
of table, tbl_id is
+ * persisted in its place.
+ *
+ */
+public class MTableColumnStatistics {
+
+  private MTable table;
+  private String dbName;
+  private String tableName;
+  private String colName;
+  private String colType;
+
+  private Long longLowValue;
+  private Long longHighValue;
+  private Double doubleLowValue;
+  private Double doubleHighValue;
+  private String decimalLowValue;
+  private String decimalHighValue;
+  private Long numNulls;
+  private Long numDVs;
+  private byte[] bitVector;
+  private Double avgColLen;
+  private Long maxColLen;
+  private Long numTrues;
+  private Long numFalses;
+  private long lastAnalyzed;
+
+  public MTableColumnStatistics() {}
+
+  public MTable getTable() {
+    return table;
+  }
+
+  public void setTable(MTable table) {
+    this.table = table;
+  }
+
+  public String getTableName() {
+    return tableName;
+  }
+
+  public void setTableName(String tableName) {
+    this.tableName = tableName;
+  }
+
+  public String getColName() {
+    return colName;
+  }
+
+  public void setColName(String colName) {
+    this.colName = colName;
+  }
+
+  public String getColType() {
+    return colType;
+  }
+
+  public void setColType(String colType) {
+    this.colType = colType;
+  }
+
+  public Long getNumNulls() {
+    return numNulls;
+  }
+
+  public void setNumNulls(long numNulls) {
+    this.numNulls = numNulls;
+  }
+
+  public Long getNumDVs() {
+    return numDVs;
+  }
+
+  public void setNumDVs(long numDVs) {
+    this.numDVs = numDVs;
+  }
+
+  public Double getAvgColLen() {
+    return avgColLen;
+  }
+
+  public void setAvgColLen(double avgColLen) {
+    this.avgColLen = avgColLen;
+  }
+
+  public Long getMaxColLen() {
+    return maxColLen;
+  }
+
+  public void setMaxColLen(long maxColLen) {
+    this.maxColLen = maxColLen;
+  }
+
+  public Long getNumTrues() {
+    return numTrues;
+  }
+
+  public void setNumTrues(long numTrues) {
+    this.numTrues = numTrues;
+  }
+
+  public Long getNumFalses() {
+    return numFalses;
+  }
+
+  public void setNumFalses(long numFalses) {
+    this.numFalses = numFalses;
+  }
+
+  public long getLastAnalyzed() {
+    return lastAnalyzed;
+  }
+
+  public void setLastAnalyzed(long lastAnalyzed) {
+    this.lastAnalyzed = lastAnalyzed;
+  }
+
+  public String getDbName() {
+    return dbName;
+  }
+
+  public void setDbName(String dbName) {
+    this.dbName = dbName;
+  }
+
+  public void setBooleanStats(Long numTrues, Long numFalses, Long numNulls) {
+    this.numTrues = numTrues;
+    this.numFalses = numFalses;
+    this.numNulls = numNulls;
+  }
+
+  public void setLongStats(Long numNulls, Long numNDVs, byte[] bitVector, Long 
lowValue, Long highValue) {
+    this.numNulls = numNulls;
+    this.numDVs = numNDVs;
+    this.bitVector = bitVector;
+    this.longLowValue = lowValue;
+    this.longHighValue = highValue;
+  }
+
+  public void setDoubleStats(Long numNulls, Long numNDVs, byte[] bitVector, 
Double lowValue, Double highValue) {
+    this.numNulls = numNulls;
+    this.numDVs = numNDVs;
+    this.bitVector = bitVector;
+    this.doubleLowValue = lowValue;
+    this.doubleHighValue = highValue;
+  }
+
+  public void setDecimalStats(
+      Long numNulls, Long numNDVs, byte[] bitVector, String lowValue, String 
highValue) {
+    this.numNulls = numNulls;
+    this.numDVs = numNDVs;
+    this.bitVector = bitVector;
+    this.decimalLowValue = lowValue;
+    this.decimalHighValue = highValue;
+  }
+
+  public void setStringStats(Long numNulls, Long numNDVs, byte[] bitVector, 
Long maxColLen, Double avgColLen) {
+    this.numNulls = numNulls;
+    this.numDVs = numNDVs;
+    this.bitVector = bitVector;
+    this.maxColLen = maxColLen;
+    this.avgColLen = avgColLen;
+  }
+
+  public void setBinaryStats(Long numNulls, Long maxColLen, Double avgColLen) {
+    this.numNulls = numNulls;
+    this.maxColLen = maxColLen;
+    this.avgColLen = avgColLen;
+  }
+
+  public void setDateStats(Long numNulls, Long numNDVs, byte[] bitVector, Long 
lowValue, Long highValue) {
+    this.numNulls = numNulls;
+    this.numDVs = numNDVs;
+    this.bitVector = bitVector;
+    this.longLowValue = lowValue;
+    this.longHighValue = highValue;
+  }
+
+  public Long getLongLowValue() {
+    return longLowValue;
+  }
+
+  public void setLongLowValue(long longLowValue) {
+    this.longLowValue = longLowValue;
+  }
+
+  public Long getLongHighValue() {
+    return longHighValue;
+  }
+
+  public void setLongHighValue(long longHighValue) {
+    this.longHighValue = longHighValue;
+  }
+
+  public Double getDoubleLowValue() {
+    return doubleLowValue;
+  }
+
+  public void setDoubleLowValue(double doubleLowValue) {
+    this.doubleLowValue = doubleLowValue;
+  }
+
+  public Double getDoubleHighValue() {
+    return doubleHighValue;
+  }
+
+  public void setDoubleHighValue(double doubleHighValue) {
+    this.doubleHighValue = doubleHighValue;
+  }
+
+
+  public String getDecimalLowValue() {
+    return decimalLowValue;
+  }
+
+  public void setDecimalLowValue(String decimalLowValue) {
+    this.decimalLowValue = decimalLowValue;
+  }
+
+  public String getDecimalHighValue() {
+    return decimalHighValue;
+  }
+
+  public void setDecimalHighValue(String decimalHighValue) {
+    this.decimalHighValue = decimalHighValue;
+  }
+
+  public byte[] getBitVector() {
+    return bitVector;
+  }
+
+  public void setBitVector(byte[] bitVector) {
+    this.bitVector = bitVector;
+  }
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/98ec28ed/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTablePrivilege.java
----------------------------------------------------------------------
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTablePrivilege.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTablePrivilege.java
new file mode 100644
index 0000000..bee33ee
--- /dev/null
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MTablePrivilege.java
@@ -0,0 +1,139 @@
+/**
+ * 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.model;
+
+public class MTablePrivilege {
+
+  private String principalName;
+
+  private String principalType;
+
+  private MTable table;
+
+  private String privilege;
+
+  private int createTime;
+
+  private String grantor;
+
+  private String grantorType;
+
+  private boolean grantOption;
+
+  public MTablePrivilege() {
+  }
+
+  public MTablePrivilege(String principalName, String principalType,
+      MTable table, String privilege, int createTime,
+      String grantor, String grantorType, boolean grantOption) {
+    super();
+    this.principalName = principalName;
+    this.principalType = principalType;
+    this.table = table;
+    this.privilege = privilege;
+    this.createTime = createTime;
+    this.grantor = grantor;
+    this.grantorType = grantorType;
+    this.grantOption = grantOption;
+  }
+
+  public String getPrincipalName() {
+    return principalName;
+  }
+
+  public void setPrincipalName(String principalName) {
+    this.principalName = principalName;
+  }
+
+
+  /**
+   * @return a set of privileges this user/role/group has
+   */
+  public String getPrivilege() {
+    return privilege;
+  }
+
+  /**
+   * @param dbPrivilege a set of privileges this user/role/group has
+   */
+  public void setPrivilege(String dbPrivilege) {
+    this.privilege = dbPrivilege;
+  }
+
+  /**
+   * @return create time
+   */
+  public int getCreateTime() {
+    return createTime;
+  }
+
+  /**
+   * @param createTime create time
+   */
+  public void setCreateTime(int createTime) {
+    this.createTime = createTime;
+  }
+
+  /**
+   * @return the grantor
+   */
+  public String getGrantor() {
+    return grantor;
+  }
+
+  /**
+   * @param grantor
+   */
+  public void setGrantor(String grantor) {
+    this.grantor = grantor;
+  }
+
+  public String getPrincipalType() {
+    return principalType;
+  }
+
+  public void setPrincipalType(String principalType) {
+    this.principalType = principalType;
+  }
+
+  public MTable getTable() {
+    return table;
+  }
+
+  public void setTable(MTable table) {
+    this.table = table;
+  }
+
+  public boolean getGrantOption() {
+    return grantOption;
+  }
+
+  public void setGrantOption(boolean grantOption) {
+    this.grantOption = grantOption;
+  }
+
+  public String getGrantorType() {
+    return grantorType;
+  }
+
+  public void setGrantorType(String grantorType) {
+    this.grantorType = grantorType;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/98ec28ed/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MType.java
----------------------------------------------------------------------
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MType.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MType.java
new file mode 100644
index 0000000..fb8d82f
--- /dev/null
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MType.java
@@ -0,0 +1,105 @@
+/**
+ * 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.model;
+
+import java.util.List;
+
+/**
+ * Represents a Hive type
+ *
+ */
+public class MType {
+  private String name;
+  private String type1;
+  private String type2;
+  private List<MFieldSchema> fields;
+  
+  /**
+   * @param name
+   * @param type1
+   * @param type2
+   * @param fields
+   */
+  public MType(String name, String type1, String type2, List<MFieldSchema> 
fields) {
+    this.name = name;
+    this.type1 = type1;
+    this.type2 = type2;
+    this.fields = fields;
+  }
+
+  public MType() {}
+  
+  /**
+   * @return the name
+   */
+  public String getName() {
+    return name;
+  }
+  /**
+   * @param name the name to set
+   */
+  public void setName(String name) {
+    this.name = name;
+  }
+  /**
+   * @return the type1
+   */
+  public String getType1() {
+    return type1;
+  }
+
+  /**
+   * @param type1 the type1 to set
+   */
+  public void setType1(String type1) {
+    this.type1 = type1;
+  }
+
+  /**
+   * @return the type2
+   */
+  public String getType2() {
+    return type2;
+  }
+
+  /**
+   * @param type2 the type2 to set
+   */
+  public void setType2(String type2) {
+    this.type2 = type2;
+  }
+
+  /**
+   * @return the fields
+   */
+  public List<MFieldSchema> getFields() {
+    return fields;
+  }
+  /**
+   * @param fields the fields to set
+   */
+  public void setFields(List<MFieldSchema> fields) {
+    this.fields = fields;
+  }
+  
+  
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/98ec28ed/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MVersionTable.java
----------------------------------------------------------------------
diff --git 
a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MVersionTable.java
 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MVersionTable.java
new file mode 100644
index 0000000..c6c4289
--- /dev/null
+++ 
b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MVersionTable.java
@@ -0,0 +1,57 @@
+/**
+ * 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.model;
+
+public class MVersionTable {
+  private String schemaVersion;
+  private String versionComment;
+
+  public MVersionTable() {}
+
+  public MVersionTable(String schemaVersion, String versionComment) {
+    this.schemaVersion = schemaVersion;
+    this.versionComment = versionComment;
+  }
+  /**
+   * @return the versionComment
+   */
+  public String getVersionComment() {
+    return versionComment;
+  }
+  /**
+   * @param versionComment the versionComment to set
+   */
+  public void setVersionComment(String versionComment) {
+    this.versionComment = versionComment;
+  }
+
+  /**
+   * @return the schemaVersion
+   */
+  public String getSchemaVersion() {
+    return schemaVersion;
+  }
+  /**
+   * @param schemaVersion the schemaVersion to set
+   */
+  public void setSchemaVersion(String schemaVersion) {
+    this.schemaVersion = schemaVersion;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/hive/blob/98ec28ed/standalone-metastore/src/main/resources/package.jdo
----------------------------------------------------------------------
diff --git a/standalone-metastore/src/main/resources/package.jdo 
b/standalone-metastore/src/main/resources/package.jdo
new file mode 100644
index 0000000..570fd44
--- /dev/null
+++ b/standalone-metastore/src/main/resources/package.jdo
@@ -0,0 +1,1088 @@
+<?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>
+      <field name="name">  
+        <column name="NAME" length="128" jdbc-type="VARCHAR"/>
+        <index name="UniqueDatabase" unique="true"/>
+      </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="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="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="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>
+    </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="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>
+    </class>
+
+    <class name="MDBPrivilege" table="DB_PRIVS" identity-type="datastore" 
detachable="true">
+      
+      <index name="DBPrivilegeIndex" unique="true">
+        <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>
+    </class>
+
+    <class name="MTablePrivilege" table="TBL_PRIVS" identity-type="datastore" 
detachable="true">
+    
+      <index name="TablePrivilegeIndex" unique="false">
+        <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>
+    </class>
+
+    <class name="MPartitionPrivilege" table="PART_PRIVS" 
identity-type="datastore" detachable="true">
+    
+      <index name="PartPrivilegeIndex" unique="false">
+        <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>
+    </class>
+
+    <class name="MTableColumnPrivilege" table="TBL_COL_PRIVS" 
identity-type="datastore" detachable="true">
+    
+     <index name="TableColumnPrivilegeIndex" unique="false">
+        <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>
+    </class>
+
+    <class name="MPartitionColumnPrivilege" table="PART_COL_PRIVS" 
identity-type="datastore" detachable="true">
+    
+     <index name="PartitionColumnPrivilegeIndex" unique="false">
+        <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>
+    </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="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 ="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 ="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>
+        <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="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>
+
+
+  </package>
+</jdo>
+

Reply via email to