hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1328473 [1/10] - in /hive/branches/branch-0.9: ./ common/src/java/org/apache/hadoop/hive/conf/ conf/ contrib/src/test/results/clientnegative/ contrib/src/test/results/clientpositive/ metastore/if/ metastore/scripts/upgrade/derby/ metastore...
Date Fri, 20 Apr 2012 18:16:14 GMT
Author: hashutosh
Date: Fri Apr 20 18:16:12 2012
New Revision: 1328473

URL: http://svn.apache.org/viewvc?rev=1328473&view=rev
Log:
HIVE-2965 : Revert HIVE-2612 Merged from trunk (hashutosh)

Removed:
    hive/branches/branch-0.9/metastore/scripts/upgrade/derby/009-HIVE-2612.derby.sql
    hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/009-HIVE-2612.mysql.sql
    hive/branches/branch-0.9/metastore/scripts/upgrade/postgres/009-HIVE-2612.postgres.sql
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/RegionStorageDescriptor.java
    hive/branches/branch-0.9/metastore/src/model/org/apache/hadoop/hive/metastore/model/MRegionStorageDescriptor.java
Modified:
    hive/branches/branch-0.9/   (props changed)
    hive/branches/branch-0.9/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
    hive/branches/branch-0.9/conf/hive-default.xml.template
    hive/branches/branch-0.9/contrib/src/test/results/clientnegative/serde_regex.q.out
    hive/branches/branch-0.9/contrib/src/test/results/clientpositive/fileformat_base64.q.out
    hive/branches/branch-0.9/contrib/src/test/results/clientpositive/serde_regex.q.out
    hive/branches/branch-0.9/metastore/if/hive_metastore.thrift
    hive/branches/branch-0.9/metastore/scripts/upgrade/derby/hive-schema-0.9.0.derby.sql
    hive/branches/branch-0.9/metastore/scripts/upgrade/derby/upgrade-0.8.0-to-0.9.0.derby.sql
    hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/hive-schema-0.9.0.mysql.sql
    hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/upgrade-0.8.0-to-0.9.0.mysql.sql
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Index.java
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Partition.java
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.java
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/StorageDescriptor.java
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-php/ThriftHiveMetastore.php
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-php/hive_metastore/hive_metastore_types.php
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-php/hive_metastore_constants.php
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-php/hive_metastore_types.php
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
    hive/branches/branch-0.9/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
    hive/branches/branch-0.9/metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java
    hive/branches/branch-0.9/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
    hive/branches/branch-0.9/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java
    hive/branches/branch-0.9/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
    hive/branches/branch-0.9/metastore/src/model/org/apache/hadoop/hive/metastore/model/MStorageDescriptor.java
    hive/branches/branch-0.9/metastore/src/model/package.jdo
    hive/branches/branch-0.9/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java
    hive/branches/branch-0.9/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
    hive/branches/branch-0.9/ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
    hive/branches/branch-0.9/ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
    hive/branches/branch-0.9/ql/src/java/org/apache/hadoop/hive/ql/parse/ErrorMsg.java
    hive/branches/branch-0.9/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java
    hive/branches/branch-0.9/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
    hive/branches/branch-0.9/ql/src/java/org/apache/hadoop/hive/ql/plan/CreateTableDesc.java
    hive/branches/branch-0.9/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/create_union_table.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/ctas.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/fileformat_sequencefile.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/fileformat_text.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/input15.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/inputddl1.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/inputddl2.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/inputddl3.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/merge3.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/rcfile_createas1.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/smb_mapjoin9.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/symlink_text_input_format.q.out
    hive/branches/branch-0.9/ql/src/test/results/clientpositive/union25.q.out

Propchange: hive/branches/branch-0.9/
------------------------------------------------------------------------------
  Merged /hive/trunk:r1328469

Modified: hive/branches/branch-0.9/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/branches/branch-0.9/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Fri Apr 20 18:16:12 2012
@@ -571,12 +571,6 @@ public class HiveConf extends Configurat
     HIVE_START_CLEANUP_SCRATCHDIR("hive.start.cleanup.scratchdir", false),
     HIVE_INSERT_INTO_MULTILEVEL_DIRS("hive.insert.into.multilevel.dirs", false),
     HIVE_WAREHOUSE_SUBDIR_INHERIT_PERMS("hive.warehouse.subdir.inherit.perms", false),
-
-    // parameters for using multiple clusters in a hive instance
-    HIVE_USE_INPUT_PRIMARY_REGION("hive.use.input.primary.region", true),
-    HIVE_DEFAULT_REGION_NAME("hive.default.region.name", ""),
-    HIVE_REGION_PROPERTIES("hive.region.properties", ""),
-
     // whether insert into external tables is allowed
     HIVE_INSERT_INTO_EXTERNAL_TABLES("hive.insert.into.external.tables", true),
 

Modified: hive/branches/branch-0.9/conf/hive-default.xml.template
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/conf/hive-default.xml.template?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/conf/hive-default.xml.template (original)
+++ hive/branches/branch-0.9/conf/hive-default.xml.template Fri Apr 20 18:16:12 2012
@@ -23,7 +23,7 @@
 <!-- WARNING!!! Any changes you make to this file will be ignored by Hive. -->
 <!-- WARNING!!! You must make your changes in hive-site.xml instead.       -->
 
-
+  
 <!-- Hive Execution Parameters -->
 <property>
   <name>mapred.reduce.tasks</name>
@@ -1022,45 +1022,45 @@
   <name>hive.security.authorization.manager</name>
   <value>org.apache.hadoop.hive.ql.security.authorization.DefaultHiveAuthorizationProvider</value>
   <description>the hive client authorization manager class name.
-  The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.
+  The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider. 
   </description>
 </property>
 
 <property>
   <name>hive.security.authenticator.manager</name>
   <value>org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator</value>
-  <description>hive client authenticator manager class name.
+  <description>hive client authenticator manager class name. 
   The user defined authenticator should implement interface org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider.</description>
 </property>
 
 <property>
   <name>hive.security.authorization.createtable.user.grants</name>
   <value></value>
-  <description>the privileges automatically granted to some users whenever a table gets created.
-   An example like "userX,userY:select;userZ:create" will grant select privilege to userX and userY,
+  <description>the privileges automatically granted to some users whenever a table gets created. 
+   An example like "userX,userY:select;userZ:create" will grant select privilege to userX and userY, 
    and grant create privilege to userZ whenever a new table created.</description>
 </property>
 
 <property>
   <name>hive.security.authorization.createtable.group.grants</name>
   <value></value>
-  <description>the privileges automatically granted to some groups whenever a table gets created.
-   An example like "groupX,groupY:select;groupZ:create" will grant select privilege to groupX and groupY,
+  <description>the privileges automatically granted to some groups whenever a table gets created. 
+   An example like "groupX,groupY:select;groupZ:create" will grant select privilege to groupX and groupY, 
    and grant create privilege to groupZ whenever a new table created.</description>
 </property>
 
 <property>
   <name>hive.security.authorization.createtable.role.grants</name>
   <value></value>
-  <description>the privileges automatically granted to some roles whenever a table gets created.
-   An example like "roleX,roleY:select;roleZ:create" will grant select privilege to roleX and roleY,
+  <description>the privileges automatically granted to some roles whenever a table gets created. 
+   An example like "roleX,roleY:select;roleZ:create" will grant select privilege to roleX and roleY, 
    and grant create privilege to roleZ whenever a new table created.</description>
 </property>
 
 <property>
   <name>hive.security.authorization.createtable.owner.grants</name>
   <value></value>
-  <description>the privileges automatically granted to the owner whenever a table gets created.
+  <description>the privileges automatically granted to the owner whenever a table gets created. 
    An example like "select,drop" will grant select and drop privilege to the owner of the table</description>
 </property>
 
@@ -1068,7 +1068,7 @@
   <name>hive.metastore.authorization.storage.checks</name>
   <value>false</value>
   <description>Should the metastore do authorization checks against the underlying storage
-  for operations like drop-partition (disallow the drop-partition if the user in
+  for operations like drop-partition (disallow the drop-partition if the user in 
   question doesn't have permissions to delete the corresponding directory
   on the storage).</description>
 </property>
@@ -1082,7 +1082,7 @@
 <property>
   <name>hive.index.compact.file.ignore.hdfs</name>
   <value>false</value>
-  <description>True the hdfs location stored in the index file will be igbored at runtime.
+  <description>True the hdfs location stored in the index file will be igbored at runtime. 
   If the data got moved or the name of the cluster got changed, the index data should still be usable.</description>
 </property>
 
@@ -1126,7 +1126,7 @@
 <property>
   <name>hive.lock.mapred.only.operation</name>
   <value>false</value>
-  <description>This param is to control whether or not only do lock on queries
+  <description>This param is to control whether or not only do lock on queries 
   that need to execute at least one mapred job.</description>
 </property>
 
@@ -1160,7 +1160,7 @@
 <property>
   <name>hive.rework.mapredwork</name>
   <value>false</value>
-  <description>should rework the mapred work or not.
+  <description>should rework the mapred work or not. 
   This is first introduced by SymlinkTextInputFormat to replace symlink files with real paths at compile time.</description>
 </property>
 
@@ -1168,9 +1168,9 @@
   <name>hive.exec.concatenate.check.index</name>
   <value>true</value>
   <description>If this sets to true, hive will throw error when doing
-   'alter table tbl_name [partSpec] concatenate' on a table/partition
-    that has indexes on it. The reason the user want to set this to true
-    is because it can help user to avoid handling all index drop, recreation,
+   'alter table tbl_name [partSpec] concatenate' on a table/partition 
+    that has indexes on it. The reason the user want to set this to true 
+    is because it can help user to avoid handling all index drop, recreation, 
     rebuild work. This is very helpful for tables with thousands of partitions.</description>
 </property>
 
@@ -1185,14 +1185,14 @@
 	<name>hive.io.exception.handlers</name>
 	<value></value>
 	<description>A list of io exception handler class names. This is used
-		to construct a list exception handlers to handle exceptions thrown
+		to construct a list exception handlers to handle exceptions thrown 
 		by record readers</description>
 </property>
 
 <property>
   <name>hive.autogen.columnalias.prefix.label</name>
   <value>_c</value>
-  <description>String used as a prefix when auto generating column alias.
+  <description>String used as a prefix when auto generating column alias. 
   By default the prefix label will be appended with a column position number to form the column alias. Auto generation would happen if an aggregate function is used in a select clause without an explicit alias.</description>
 </property>
 
@@ -1223,7 +1223,7 @@
 <property>
   <name>hive.insert.into.multilevel.dirs</name>
   <value>false</value>
-  <description>Where to insert into multilevel directories like
+  <description>Where to insert into multilevel directories like 
   "insert directory '/HIVEFT25686/chinna/' from table"</description>
 </property>
 
@@ -1236,24 +1236,6 @@
 </property>
 
 <property>
-  <name>hive.use.input.primary.region</name>
-  <value>true</value>
-  <description>When creating a table from an input table, create the table in the input table's primary region.</description>
-</property>
-
-<property>
-  <name>hive.default.region.name</name>
-  <value>default</value>
-  <description>The default region name</description>
-</property>
-
-<property>
-  <name>hive.region.properties</name>
-  <value></value>
-  <description>The default filesystem and jobtracker for a region</description>
-</property>
-
-<property>
   <name>hive.exec.job.debug.capture.stacktraces</name>
   <value>true</value>
   <description>Whether or not stack traces parsed from the task logs of a sampled failed task for

Modified: hive/branches/branch-0.9/contrib/src/test/results/clientnegative/serde_regex.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/contrib/src/test/results/clientnegative/serde_regex.q.out?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/contrib/src/test/results/clientnegative/serde_regex.q.out (original)
+++ hive/branches/branch-0.9/contrib/src/test/results/clientnegative/serde_regex.q.out Fri Apr 20 18:16:12 2012
@@ -53,7 +53,6 @@ STAGE PLANS:
           input format: org.apache.hadoop.mapred.TextInputFormat
           # buckets: -1
           output format: org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat
-          primaryRegionName: 
           serde name: org.apache.hadoop.hive.contrib.serde2.RegexSerDe
           serde properties:
             input.regex ([^ ]*) ([^ ]*) ([^ ]*) (-|\[[^\]]*\]) ([^ "]*|"[^"]*") (-|[0-9]*) (-|[0-9]*)(?: ([^ "]*|"[^"]*") ([^ "]*|"[^"]*"))?

Modified: hive/branches/branch-0.9/contrib/src/test/results/clientpositive/fileformat_base64.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/contrib/src/test/results/clientpositive/fileformat_base64.q.out?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/contrib/src/test/results/clientpositive/fileformat_base64.q.out (original)
+++ hive/branches/branch-0.9/contrib/src/test/results/clientpositive/fileformat_base64.q.out Fri Apr 20 18:16:12 2012
@@ -27,7 +27,6 @@ STAGE PLANS:
           input format: org.apache.hadoop.hive.contrib.fileformat.base64.Base64TextInputFormat
           # buckets: -1
           output format: org.apache.hadoop.hive.contrib.fileformat.base64.Base64TextOutputFormat
-          primaryRegionName: 
           name: base64_test
           isExternal: false
 

Modified: hive/branches/branch-0.9/contrib/src/test/results/clientpositive/serde_regex.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/contrib/src/test/results/clientpositive/serde_regex.q.out?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/contrib/src/test/results/clientpositive/serde_regex.q.out (original)
+++ hive/branches/branch-0.9/contrib/src/test/results/clientpositive/serde_regex.q.out Fri Apr 20 18:16:12 2012
@@ -53,7 +53,6 @@ STAGE PLANS:
           input format: org.apache.hadoop.mapred.TextInputFormat
           # buckets: -1
           output format: org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat
-          primaryRegionName: 
           serde name: org.apache.hadoop.hive.contrib.serde2.RegexSerDe
           serde properties:
             input.regex ([^ ]*) ([^ ]*) ([^ ]*) (-|\[[^\]]*\]) ([^ "]*|"[^"]*") (-|[0-9]*) (-|[0-9]*)(?: ([^ "]*|"[^"]*") ([^ "]*|"[^"]*"))?

Modified: hive/branches/branch-0.9/metastore/if/hive_metastore.thrift
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/metastore/if/hive_metastore.thrift?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/metastore/if/hive_metastore.thrift (original)
+++ hive/branches/branch-0.9/metastore/if/hive_metastore.thrift Fri Apr 20 18:16:12 2012
@@ -67,7 +67,7 @@ const string HIVE_FILTER_FIELD_PARAMS = 
 const string HIVE_FILTER_FIELD_LAST_ACCESS = "hive_filter_field_last_access__"
 
 enum PartitionEventType {
-  LOAD_DONE = 1,
+  LOAD_DONE = 1,  
 }
 
 struct HiveObjectRef{
@@ -131,12 +131,6 @@ struct Order {
   2: i32    order // asc(1) or desc(0)
 }
 
-// This object holds locations for all secondary regions
-struct RegionStorageDescriptor {
-  1: string regionName,   // region name
-  2: string location      // location
-}
-
 // this object holds all the information about physical storage of the data belonging to a table
 struct StorageDescriptor {
   1: list<FieldSchema> cols,  // required (refer to types defined above)
@@ -148,9 +142,7 @@ struct StorageDescriptor {
   7: SerDeInfo    serdeInfo,  // serialization and deserialization information
   8: list<string> bucketCols, // reducer grouping columns and clustering columns and bucketing columns`
   9: list<Order>  sortCols,   // sort order of the data in each bucket
-  10: map<string, string> parameters, // any user supplied key value hash
-  11: string primaryRegionName,      // name of the primary region
-  12: list<RegionStorageDescriptor> secondaryRegions   // secondary regions
+  10: map<string, string> parameters // any user supplied key value hash
 }
 
 // table information
@@ -256,7 +248,7 @@ service ThriftHiveMetastore extends fb30
   list<string> get_databases(1:string pattern) throws(1:MetaException o1)
   list<string> get_all_databases() throws(1:MetaException o1)
   void alter_database(1:string dbname, 2:Database db) throws(1:MetaException o1, 2:NoSuchObjectException o2)
-
+  
   // returns the type with given name (make seperate calls for the dependent types if needed)
   Type get_type(1:string name)  throws(1:MetaException o1, 2:NoSuchObjectException o2)
   bool create_type(1:Type type) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3)
@@ -347,11 +339,11 @@ service ThriftHiveMetastore extends fb30
   bool drop_partition(1:string db_name, 2:string tbl_name, 3:list<string> part_vals, 4:bool deleteData)
                        throws(1:NoSuchObjectException o1, 2:MetaException o2)
   bool drop_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name, 4:bool deleteData)
-                       throws(1:NoSuchObjectException o1, 2:MetaException o2)
+                       throws(1:NoSuchObjectException o1, 2:MetaException o2) 
   Partition get_partition(1:string db_name, 2:string tbl_name, 3:list<string> part_vals)
                        throws(1:MetaException o1, 2:NoSuchObjectException o2)
 
-  Partition get_partition_with_auth(1:string db_name, 2:string tbl_name, 3:list<string> part_vals,
+  Partition get_partition_with_auth(1:string db_name, 2:string tbl_name, 3:list<string> part_vals, 
       4: string user_name, 5: list<string> group_names) throws(1:MetaException o1, 2:NoSuchObjectException o2)
 
   Partition get_partition_by_name(1:string db_name 2:string tbl_name, 3:string part_name)
@@ -361,25 +353,25 @@ service ThriftHiveMetastore extends fb30
   // If max parts is given then it will return only that many.
   list<Partition> get_partitions(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1)
                        throws(1:NoSuchObjectException o1, 2:MetaException o2)
-  list<Partition> get_partitions_with_auth(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1,
-     4: string user_name, 5: list<string> group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)
+  list<Partition> get_partitions_with_auth(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1, 
+     4: string user_name, 5: list<string> group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)                       
 
   list<string> get_partition_names(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1)
                        throws(1:MetaException o2)
-
-  // get_partition*_ps methods allow filtering by a partial partition specification,
-  // as needed for dynamic partitions. The values that are not restricted should
-  // be empty strings. Nulls were considered (instead of "") but caused errors in
+                       
+  // get_partition*_ps methods allow filtering by a partial partition specification, 
+  // as needed for dynamic partitions. The values that are not restricted should 
+  // be empty strings. Nulls were considered (instead of "") but caused errors in 
   // generated Python code. The size of part_vals may be smaller than the
   // number of partition columns - the unspecified values are considered the same
   // as "".
-  list<Partition> get_partitions_ps(1:string db_name 2:string tbl_name
+  list<Partition> get_partitions_ps(1:string db_name 2:string tbl_name 
   	3:list<string> part_vals, 4:i16 max_parts=-1)
                        throws(1:MetaException o1, 2:NoSuchObjectException o2)
-  list<Partition> get_partitions_ps_with_auth(1:string db_name, 2:string tbl_name, 3:list<string> part_vals, 4:i16 max_parts=-1,
-     5: string user_name, 6: list<string> group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)
-
-  list<string> get_partition_names_ps(1:string db_name,
+  list<Partition> get_partitions_ps_with_auth(1:string db_name, 2:string tbl_name, 3:list<string> part_vals, 4:i16 max_parts=-1, 
+     5: string user_name, 6: list<string> group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)                       
+  
+  list<string> get_partition_names_ps(1:string db_name, 
   	2:string tbl_name, 3:list<string> part_vals, 4:i16 max_parts=-1)
   	                   throws(1:MetaException o1, 2:NoSuchObjectException o2)
 
@@ -410,7 +402,7 @@ service ThriftHiveMetastore extends fb30
   // thrown.
   string get_config_value(1:string name, 2:string defaultValue)
                           throws(1:ConfigValSecurityException o1)
-
+                          
   // converts a partition name into a partition values array
   list<string> partition_name_to_vals(1: string part_name)
                           throws(1: MetaException o1)
@@ -418,23 +410,23 @@ service ThriftHiveMetastore extends fb30
   // the partition cols to the values)
   map<string, string> partition_name_to_spec(1: string part_name)
                           throws(1: MetaException o1)
-
+  
   void markPartitionForEvent(1:string db_name, 2:string tbl_name, 3:map<string,string> part_vals,
-                  4:PartitionEventType eventType) throws (1: MetaException o1, 2: NoSuchObjectException o2,
+                  4:PartitionEventType eventType) throws (1: MetaException o1, 2: NoSuchObjectException o2, 
                   3: UnknownDBException o3, 4: UnknownTableException o4, 5: UnknownPartitionException o5,
-                  6: InvalidPartitionException o6)
-  bool isPartitionMarkedForEvent(1:string db_name, 2:string tbl_name, 3:map<string,string> part_vals,
+                  6: InvalidPartitionException o6) 
+  bool isPartitionMarkedForEvent(1:string db_name, 2:string tbl_name, 3:map<string,string> part_vals, 
                   4: PartitionEventType eventType) throws (1: MetaException o1, 2:NoSuchObjectException o2,
                   3: UnknownDBException o3, 4: UnknownTableException o4, 5: UnknownPartitionException o5,
-                  6: InvalidPartitionException o6)
-
+                  6: InvalidPartitionException o6) 
+                         
   //index
   Index add_index(1:Index new_index, 2: Table index_table)
                        throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
   void alter_index(1:string dbname, 2:string base_tbl_name, 3:string idx_name, 4:Index new_idx)
                        throws (1:InvalidOperationException o1, 2:MetaException o2)
   bool drop_index_by_name(1:string db_name, 2:string tbl_name, 3:string index_name, 4:bool deleteData)
-                       throws(1:NoSuchObjectException o1, 2:MetaException o2)
+                       throws(1:NoSuchObjectException o1, 2:MetaException o2) 
   Index get_index_by_name(1:string db_name 2:string tbl_name, 3:string index_name)
                        throws(1:MetaException o1, 2:NoSuchObjectException o2)
 
@@ -444,30 +436,30 @@ service ThriftHiveMetastore extends fb30
                        throws(1:MetaException o2)
 
   //authorization privileges
-
+                       
   bool create_role(1:Role role) throws(1:MetaException o1)
   bool drop_role(1:string role_name) throws(1:MetaException o1)
   list<string> get_role_names() throws(1:MetaException o1)
-  bool grant_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type,
+  bool grant_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type, 
     4:string grantor, 5:PrincipalType grantorType, 6:bool grant_option) throws(1:MetaException o1)
-  bool revoke_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type)
+  bool revoke_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type) 
                         throws(1:MetaException o1)
   list<Role> list_roles(1:string principal_name, 2:PrincipalType principal_type) throws(1:MetaException o1)
 
-  PrincipalPrivilegeSet get_privilege_set(1:HiveObjectRef hiveObject, 2:string user_name,
+  PrincipalPrivilegeSet get_privilege_set(1:HiveObjectRef hiveObject, 2:string user_name, 
     3: list<string> group_names) throws(1:MetaException o1)
-  list<HiveObjectPrivilege> list_privileges(1:string principal_name, 2:PrincipalType principal_type,
+  list<HiveObjectPrivilege> list_privileges(1:string principal_name, 2:PrincipalType principal_type, 
     3: HiveObjectRef hiveObject) throws(1:MetaException o1)
-
+  
   bool grant_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1)
   bool revoke_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1)
-
+  
   // this is used by metastore client to send UGI information to metastore server immediately
-  // after setting up a connection.
+  // after setting up a connection. 
   list<string> set_ugi(1:string user_name, 2:list<string> group_names) throws (1:MetaException o1)
 
   //Authentication (delegation token) interfaces
-
+  
   // get metastore server delegation token for use from the map/reduce tasks to authenticate
   // to metastore server
   string get_delegation_token(1:string token_owner, 2:string renewer_kerberos_principal_name)

Modified: hive/branches/branch-0.9/metastore/scripts/upgrade/derby/hive-schema-0.9.0.derby.sql
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/metastore/scripts/upgrade/derby/hive-schema-0.9.0.derby.sql?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/metastore/scripts/upgrade/derby/hive-schema-0.9.0.derby.sql (original)
+++ hive/branches/branch-0.9/metastore/scripts/upgrade/derby/hive-schema-0.9.0.derby.sql Fri Apr 20 18:16:12 2012
@@ -1,251 +1,246 @@
--- Timestamp: 2012-02-10 12:21:25.771
--- Source database is: /home/kevinwilfong/hive/mdb
--- Connection URL is: jdbc:derby:/home/kevinwilfong/hive/mdb
+-- Timestamp: 2011-09-22 15:32:02.024
+-- Source database is: /home/carl/Work/repos/hive1/metastore/scripts/upgrade/derby/mdb
+-- Connection URL is: jdbc:derby:/home/carl/Work/repos/hive1/metastore/scripts/upgrade/derby/mdb
+-- Specified schema is: APP
 -- appendLogs: false
 
 -- ----------------------------------------------
 -- DDL Statements for functions
 -- ----------------------------------------------
 
-CREATE FUNCTION "APP"."NUCLEUS_ASCII" ("C" CHAR(1)) RETURNS INTEGER LANGUAGE JAVA PARAMETER STYLE JAVA READS SQL DATA CALLED ON NULL INPUT EXTERNAL NAME 'org.datanucleus.store.rdbms.adapter.DerbySQLFunction.ascii' ;
+CREATE FUNCTION "APP"."NUCLEUS_ASCII" (C CHAR(1)) RETURNS INTEGER LANGUAGE JAVA PARAMETER STYLE JAVA READS SQL DATA CALLED ON NULL INPUT EXTERNAL NAME 'org.datanucleus.store.rdbms.adapter.DerbySQLFunction.ascii' ;
 
-CREATE FUNCTION "APP"."NUCLEUS_MATCHES" ("TEXT" VARCHAR(8000),"PATTERN" VARCHAR(8000)) RETURNS INTEGER LANGUAGE JAVA PARAMETER STYLE JAVA READS SQL DATA CALLED ON NULL INPUT EXTERNAL NAME 'org.datanucleus.store.rdbms.adapter.DerbySQLFunction.matches' ;
+CREATE FUNCTION "APP"."NUCLEUS_MATCHES" (TEXT VARCHAR(8000),PATTERN VARCHAR(8000)) RETURNS INTEGER LANGUAGE JAVA PARAMETER STYLE JAVA READS SQL DATA CALLED ON NULL INPUT EXTERNAL NAME 'org.datanucleus.store.rdbms.adapter.DerbySQLFunction.matches' ;
 
 -- ----------------------------------------------
 -- DDL Statements for tables
 -- ----------------------------------------------
 
-CREATE TABLE "APP"."SDS" ("SD_ID" BIGINT NOT NULL, "INPUT_FORMAT" VARCHAR(4000), "IS_COMPRESSED" CHAR(1) NOT NULL, "LOCATION" VARCHAR(4000), "NUM_BUCKETS" INTEGER NOT NULL, "OUTPUT_FORMAT" VARCHAR(4000), "SERDE_ID" BIGINT, "CD_ID" BIGINT, "PRIMARY_REGION_NAME" VARCHAR(512) NOT NULL DEFAULT '');
+CREATE TABLE "APP"."DBS" ("DB_ID" BIGINT NOT NULL, "DESC" VARCHAR(4000), "DB_LOCATION_URI" VARCHAR(4000) NOT NULL, "NAME" VARCHAR(128));
 
-CREATE TABLE "APP"."ROLE_MAP" ("ROLE_GRANT_ID" BIGINT NOT NULL, "ADD_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "ROLE_ID" BIGINT);
+CREATE TABLE "APP"."TBL_PRIVS" ("TBL_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "TBL_PRIV" VARCHAR(128), "TBL_ID" BIGINT);
 
-CREATE TABLE "APP"."ROLES" ("ROLE_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "OWNER_NAME" VARCHAR(128), "ROLE_NAME" VARCHAR(128));
+CREATE TABLE "APP"."DATABASE_PARAMS" ("DB_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(180) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
 
 CREATE TABLE "APP"."TBL_COL_PRIVS" ("TBL_COLUMN_GRANT_ID" BIGINT NOT NULL, "COLUMN_NAME" VARCHAR(128), "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "TBL_COL_PRIV" VARCHAR(128), "TBL_ID" BIGINT);
 
-CREATE TABLE "APP"."NUCLEUS_TABLES" ("CLASS_NAME" VARCHAR(128) NOT NULL, "TABLE_NAME" VARCHAR(128) NOT NULL, "TYPE" VARCHAR(4) NOT NULL, "OWNER" VARCHAR(2) NOT NULL, "VERSION" VARCHAR(20) NOT NULL, "INTERFACE_NAME" VARCHAR(256) DEFAULT NULL);
+CREATE TABLE "APP"."SERDE_PARAMS" ("SERDE_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
 
-CREATE TABLE "APP"."SERDES" ("SERDE_ID" BIGINT NOT NULL, "NAME" VARCHAR(128), "SLIB" VARCHAR(4000));
+CREATE TABLE "APP"."COLUMNS_V2" ("CD_ID" BIGINT NOT NULL, "COMMENT" VARCHAR(4000), "COLUMN_NAME" VARCHAR(128) NOT NULL, "TYPE_NAME" VARCHAR(4000), "INTEGER_IDX" INTEGER NOT NULL);
 
-CREATE TABLE "APP"."PART_PRIVS" ("PART_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PART_ID" BIGINT, "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "PART_PRIV" VARCHAR(128));
+CREATE TABLE "APP"."SORT_COLS" ("SD_ID" BIGINT NOT NULL, "COLUMN_NAME" VARCHAR(128), "ORDER" INTEGER NOT NULL, "INTEGER_IDX" INTEGER NOT NULL);
 
-CREATE TABLE "APP"."GLOBAL_PRIVS" ("USER_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "USER_PRIV" VARCHAR(128));
+CREATE TABLE "APP"."CDS" ("CD_ID" BIGINT NOT NULL);
 
-CREATE TABLE "APP"."SD_PARAMS" ("SD_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
+CREATE TABLE "APP"."PARTITION_KEY_VALS" ("PART_ID" BIGINT NOT NULL, "PART_KEY_VAL" VARCHAR(256), "INTEGER_IDX" INTEGER NOT NULL);
 
 CREATE TABLE "APP"."DB_PRIVS" ("DB_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "DB_ID" BIGINT, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "DB_PRIV" VARCHAR(128));
 
-CREATE TABLE "APP"."TBL_PRIVS" ("TBL_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "TBL_PRIV" VARCHAR(128), "TBL_ID" BIGINT);
-
-CREATE TABLE "APP"."REGION_SDS" ("SD_ID" BIGINT NOT NULL, "REGION_NAME" VARCHAR(512) NOT NULL, "LOCATION" VARCHAR(4000));
-
-CREATE TABLE "APP"."BUCKETING_COLS" ("SD_ID" BIGINT NOT NULL, "BUCKET_COL_NAME" VARCHAR(256), "INTEGER_IDX" INTEGER NOT NULL);
+CREATE TABLE "APP"."IDXS" ("INDEX_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "DEFERRED_REBUILD" CHAR(1) NOT NULL, "INDEX_HANDLER_CLASS" VARCHAR(4000), "INDEX_NAME" VARCHAR(128), "INDEX_TBL_ID" BIGINT, "LAST_ACCESS_TIME" INTEGER NOT NULL, "ORIG_TBL_ID" BIGINT, "SD_ID" BIGINT);
 
-CREATE TABLE "APP"."SEQUENCE_TABLE" ("SEQUENCE_NAME" VARCHAR(256) NOT NULL, "NEXT_VAL" BIGINT NOT NULL);
+CREATE TABLE "APP"."INDEX_PARAMS" ("INDEX_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
 
-CREATE TABLE "APP"."PART_COL_PRIVS" ("PART_COLUMN_GRANT_ID" BIGINT NOT NULL, "COLUMN_NAME" VARCHAR(128), "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PART_ID" BIGINT, "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "PART_COL_PRIV" VARCHAR(128));
+CREATE TABLE "APP"."PARTITIONS" ("PART_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "LAST_ACCESS_TIME" INTEGER NOT NULL, "PART_NAME" VARCHAR(767), "SD_ID" BIGINT, "TBL_ID" BIGINT);
 
-CREATE TABLE "APP"."COLUMNS_V2" ("CD_ID" BIGINT NOT NULL, "COMMENT" VARCHAR(4000), "COLUMN_NAME" VARCHAR(128) NOT NULL, "TYPE_NAME" VARCHAR(4000), "INTEGER_IDX" INTEGER NOT NULL);
+CREATE TABLE "APP"."SERDES" ("SERDE_ID" BIGINT NOT NULL, "NAME" VARCHAR(128), "SLIB" VARCHAR(4000));
 
-CREATE TABLE "APP"."PARTITION_EVENTS" ("PART_NAME_ID" BIGINT NOT NULL, "DB_NAME" VARCHAR(128), "EVENT_TIME" BIGINT NOT NULL, "EVENT_TYPE" INTEGER NOT NULL, "PARTITION_NAME" VARCHAR(767), "TBL_NAME" VARCHAR(128));
+CREATE TABLE "APP"."PART_PRIVS" ("PART_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PART_ID" BIGINT, "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "PART_PRIV" VARCHAR(128));
 
-CREATE TABLE "APP"."PARTITION_PARAMS" ("PART_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
+CREATE TABLE "APP"."ROLE_MAP" ("ROLE_GRANT_ID" BIGINT NOT NULL, "ADD_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "ROLE_ID" BIGINT);
 
-CREATE TABLE "APP"."TBLS" ("TBL_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "DB_ID" BIGINT, "LAST_ACCESS_TIME" INTEGER NOT NULL, "OWNER" VARCHAR(767), "RETENTION" INTEGER NOT NULL, "SD_ID" BIGINT, "TBL_NAME" VARCHAR(128), "TBL_TYPE" VARCHAR(128), "VIEW_EXPANDED_TEXT" LONG VARCHAR, "VIEW_ORIGINAL_TEXT" LONG VARCHAR);
+CREATE TABLE "APP"."TYPES" ("TYPES_ID" BIGINT NOT NULL, "TYPE_NAME" VARCHAR(128), "TYPE1" VARCHAR(767), "TYPE2" VARCHAR(767));
 
-CREATE TABLE "APP"."PARTITIONS" ("PART_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "LAST_ACCESS_TIME" INTEGER NOT NULL, "PART_NAME" VARCHAR(767), "SD_ID" BIGINT, "TBL_ID" BIGINT);
+CREATE TABLE "APP"."GLOBAL_PRIVS" ("USER_GRANT_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "USER_PRIV" VARCHAR(128));
 
-CREATE TABLE "APP"."TABLE_PARAMS" ("TBL_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
+CREATE TABLE "APP"."PARTITION_PARAMS" ("PART_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
 
-CREATE TABLE "APP"."CDS" ("CD_ID" BIGINT NOT NULL);
+CREATE TABLE "APP"."PARTITION_EVENTS" ("PART_NAME_ID" BIGINT NOT NULL, "DB_NAME" VARCHAR(128), "EVENT_TIME" BIGINT NOT NULL, "EVENT_TYPE" INTEGER NOT NULL, "PARTITION_NAME" VARCHAR(767), "TBL_NAME" VARCHAR(128));
 
-CREATE TABLE "APP"."SORT_COLS" ("SD_ID" BIGINT NOT NULL, "COLUMN_NAME" VARCHAR(128), "ORDER" INTEGER NOT NULL, "INTEGER_IDX" INTEGER NOT NULL);
+CREATE TABLE "APP"."COLUMNS" ("SD_ID" BIGINT NOT NULL, "COMMENT" VARCHAR(256), "COLUMN_NAME" VARCHAR(128) NOT NULL, "TYPE_NAME" VARCHAR(4000) NOT NULL, "INTEGER_IDX" INTEGER NOT NULL);
 
-CREATE TABLE "APP"."TYPE_FIELDS" ("TYPE_NAME" BIGINT NOT NULL, "COMMENT" VARCHAR(256), "FIELD_NAME" VARCHAR(128) NOT NULL, "FIELD_TYPE" VARCHAR(767) NOT NULL, "INTEGER_IDX" INTEGER NOT NULL);
+CREATE TABLE "APP"."ROLES" ("ROLE_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "OWNER_NAME" VARCHAR(128), "ROLE_NAME" VARCHAR(128));
 
-CREATE TABLE "APP"."SERDE_PARAMS" ("SERDE_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
+CREATE TABLE "APP"."TBLS" ("TBL_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "DB_ID" BIGINT, "LAST_ACCESS_TIME" INTEGER NOT NULL, "OWNER" VARCHAR(767), "RETENTION" INTEGER NOT NULL, "SD_ID" BIGINT, "TBL_NAME" VARCHAR(128), "TBL_TYPE" VARCHAR(128), "VIEW_EXPANDED_TEXT" LONG VARCHAR, "VIEW_ORIGINAL_TEXT" LONG VARCHAR);
 
 CREATE TABLE "APP"."PARTITION_KEYS" ("TBL_ID" BIGINT NOT NULL, "PKEY_COMMENT" VARCHAR(4000), "PKEY_NAME" VARCHAR(128) NOT NULL, "PKEY_TYPE" VARCHAR(767) NOT NULL, "INTEGER_IDX" INTEGER NOT NULL);
 
-CREATE TABLE "APP"."IDXS" ("INDEX_ID" BIGINT NOT NULL, "CREATE_TIME" INTEGER NOT NULL, "DEFERRED_REBUILD" CHAR(1) NOT NULL, "INDEX_HANDLER_CLASS" VARCHAR(4000), "INDEX_NAME" VARCHAR(128), "INDEX_TBL_ID" BIGINT, "LAST_ACCESS_TIME" INTEGER NOT NULL, "ORIG_TBL_ID" BIGINT, "SD_ID" BIGINT);
+CREATE TABLE "APP"."PART_COL_PRIVS" ("PART_COLUMN_GRANT_ID" BIGINT NOT NULL, "COLUMN_NAME" VARCHAR(128), "CREATE_TIME" INTEGER NOT NULL, "GRANT_OPTION" SMALLINT NOT NULL, "GRANTOR" VARCHAR(128), "GRANTOR_TYPE" VARCHAR(128), "PART_ID" BIGINT, "PRINCIPAL_NAME" VARCHAR(128), "PRINCIPAL_TYPE" VARCHAR(128), "PART_COL_PRIV" VARCHAR(128));
 
-CREATE TABLE "APP"."PARTITION_KEY_VALS" ("PART_ID" BIGINT NOT NULL, "PART_KEY_VAL" VARCHAR(256), "INTEGER_IDX" INTEGER NOT NULL);
+CREATE TABLE "APP"."SDS" ("SD_ID" BIGINT NOT NULL, "INPUT_FORMAT" VARCHAR(4000), "IS_COMPRESSED" CHAR(1) NOT NULL, "LOCATION" VARCHAR(4000), "NUM_BUCKETS" INTEGER NOT NULL, "OUTPUT_FORMAT" VARCHAR(4000), "SERDE_ID" BIGINT, "CD_ID" BIGINT);
 
-CREATE TABLE "APP"."TYPES" ("TYPES_ID" BIGINT NOT NULL, "TYPE_NAME" VARCHAR(128), "TYPE1" VARCHAR(767), "TYPE2" VARCHAR(767));
+CREATE TABLE "APP"."SEQUENCE_TABLE" ("SEQUENCE_NAME" VARCHAR(256) NOT NULL, "NEXT_VAL" BIGINT NOT NULL);
 
-CREATE TABLE "APP"."INDEX_PARAMS" ("INDEX_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
+CREATE TABLE "APP"."TABLE_PARAMS" ("TBL_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
 
-CREATE TABLE "APP"."DBS" ("DB_ID" BIGINT NOT NULL, "DESC" VARCHAR(4000), "DB_LOCATION_URI" VARCHAR(4000) NOT NULL, "NAME" VARCHAR(128));
+CREATE TABLE "APP"."BUCKETING_COLS" ("SD_ID" BIGINT NOT NULL, "BUCKET_COL_NAME" VARCHAR(256), "INTEGER_IDX" INTEGER NOT NULL);
 
-CREATE TABLE "APP"."COLUMNS" ("SD_ID" BIGINT NOT NULL, "COMMENT" VARCHAR(256), "COLUMN_NAME" VARCHAR(128) NOT NULL, "TYPE_NAME" VARCHAR(4000) NOT NULL, "INTEGER_IDX" INTEGER NOT NULL);
+CREATE TABLE "APP"."TYPE_FIELDS" ("TYPE_NAME" BIGINT NOT NULL, "COMMENT" VARCHAR(256), "FIELD_NAME" VARCHAR(128) NOT NULL, "FIELD_TYPE" VARCHAR(767) NOT NULL, "INTEGER_IDX" INTEGER NOT NULL);
 
-CREATE TABLE "APP"."DATABASE_PARAMS" ("DB_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(180) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
+CREATE TABLE "APP"."NUCLEUS_TABLES" ("CLASS_NAME" VARCHAR(128) NOT NULL, "TABLE_NAME" VARCHAR(128) NOT NULL, "TYPE" VARCHAR(4) NOT NULL, "OWNER" VARCHAR(2) NOT NULL, "VERSION" VARCHAR(20) NOT NULL, "INTERFACE_NAME" VARCHAR(256) DEFAULT NULL);
+
+CREATE TABLE "APP"."SD_PARAMS" ("SD_ID" BIGINT NOT NULL, "PARAM_KEY" VARCHAR(256) NOT NULL, "PARAM_VALUE" VARCHAR(4000));
 
 -- ----------------------------------------------
 -- DDL Statements for indexes
 -- ----------------------------------------------
 
-CREATE UNIQUE INDEX "APP"."GLOBALPRIVILEGEINDEX" ON "APP"."GLOBAL_PRIVS" ("PRINCIPAL_NAME", "PRINCIPAL_TYPE", "USER_PRIV", "GRANTOR", "GRANTOR_TYPE");
+CREATE UNIQUE INDEX "APP"."UNIQUEINDEX" ON "APP"."IDXS" ("INDEX_NAME", "ORIG_TBL_ID");
 
-CREATE UNIQUE INDEX "APP"."UNIQUEPARTITION" ON "APP"."PARTITIONS" ("PART_NAME", "TBL_ID");
+CREATE INDEX "APP"."TABLECOLUMNPRIVILEGEINDEX" ON "APP"."TBL_COL_PRIVS" ("TBL_ID", "COLUMN_NAME", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "TBL_COL_PRIV", "GRANTOR", "GRANTOR_TYPE");
 
-CREATE UNIQUE INDEX "APP"."USERROLEMAPINDEX" ON "APP"."ROLE_MAP" ("PRINCIPAL_NAME", "ROLE_ID", "GRANTOR", "GRANTOR_TYPE");
+CREATE UNIQUE INDEX "APP"."DBPRIVILEGEINDEX" ON "APP"."DB_PRIVS" ("DB_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "DB_PRIV", "GRANTOR", "GRANTOR_TYPE");
 
-CREATE UNIQUE INDEX "APP"."UNIQUEINDEX" ON "APP"."IDXS" ("INDEX_NAME", "ORIG_TBL_ID");
+CREATE INDEX "APP"."PARTPRIVILEGEINDEX" ON "APP"."PART_PRIVS" ("PART_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "PART_PRIV", "GRANTOR", "GRANTOR_TYPE");
 
 CREATE UNIQUE INDEX "APP"."ROLEENTITYINDEX" ON "APP"."ROLES" ("ROLE_NAME");
 
-CREATE UNIQUE INDEX "APP"."UNIQUE_DATABASE" ON "APP"."DBS" ("NAME");
+CREATE INDEX "APP"."TABLEPRIVILEGEINDEX" ON "APP"."TBL_PRIVS" ("TBL_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "TBL_PRIV", "GRANTOR", "GRANTOR_TYPE");
 
-CREATE UNIQUE INDEX "APP"."UNIQUE_TYPE" ON "APP"."TYPES" ("TYPE_NAME");
+CREATE UNIQUE INDEX "APP"."UNIQUETABLE" ON "APP"."TBLS" ("TBL_NAME", "DB_ID");
 
-CREATE INDEX "APP"."PARTITIONCOLUMNPRIVILEGEINDEX" ON "APP"."PART_COL_PRIVS" ("PART_ID", "COLUMN_NAME", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "PART_COL_PRIV", "GRANTOR", "GRANTOR_TYPE");
+CREATE UNIQUE INDEX "APP"."UNIQUE_DATABASE" ON "APP"."DBS" ("NAME");
 
-CREATE INDEX "APP"."TABLECOLUMNPRIVILEGEINDEX" ON "APP"."TBL_COL_PRIVS" ("TBL_ID", "COLUMN_NAME", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "TBL_COL_PRIV", "GRANTOR", "GRANTOR_TYPE");
+CREATE UNIQUE INDEX "APP"."USERROLEMAPINDEX" ON "APP"."ROLE_MAP" ("PRINCIPAL_NAME", "ROLE_ID", "GRANTOR", "GRANTOR_TYPE");
 
-CREATE INDEX "APP"."PARTPRIVILEGEINDEX" ON "APP"."PART_PRIVS" ("PART_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "PART_PRIV", "GRANTOR", "GRANTOR_TYPE");
+CREATE UNIQUE INDEX "APP"."GLOBALPRIVILEGEINDEX" ON "APP"."GLOBAL_PRIVS" ("PRINCIPAL_NAME", "PRINCIPAL_TYPE", "USER_PRIV", "GRANTOR", "GRANTOR_TYPE");
 
-CREATE UNIQUE INDEX "APP"."UNIQUETABLE" ON "APP"."TBLS" ("TBL_NAME", "DB_ID");
+CREATE UNIQUE INDEX "APP"."UNIQUE_TYPE" ON "APP"."TYPES" ("TYPE_NAME");
 
-CREATE INDEX "APP"."TABLEPRIVILEGEINDEX" ON "APP"."TBL_PRIVS" ("TBL_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "TBL_PRIV", "GRANTOR", "GRANTOR_TYPE");
+CREATE INDEX "APP"."PARTITIONCOLUMNPRIVILEGEINDEX" ON "APP"."PART_COL_PRIVS" ("PART_ID", "COLUMN_NAME", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "PART_COL_PRIV", "GRANTOR", "GRANTOR_TYPE");
 
-CREATE UNIQUE INDEX "APP"."DBPRIVILEGEINDEX" ON "APP"."DB_PRIVS" ("DB_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "DB_PRIV", "GRANTOR", "GRANTOR_TYPE");
+CREATE UNIQUE INDEX "APP"."UNIQUEPARTITION" ON "APP"."PARTITIONS" ("PART_NAME", "TBL_ID");
 
 -- ----------------------------------------------
 -- DDL Statements for keys
 -- ----------------------------------------------
 
 -- primary/unique
-ALTER TABLE "APP"."GLOBAL_PRIVS" ADD CONSTRAINT "GLOBAL_PRIVS_PK" PRIMARY KEY ("USER_GRANT_ID");
+ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_PK" PRIMARY KEY ("INDEX_ID");
 
-ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SDS_PK" PRIMARY KEY ("SD_ID");
+ALTER TABLE "APP"."TBL_COL_PRIVS" ADD CONSTRAINT "TBL_COL_PRIVS_PK" PRIMARY KEY ("TBL_COLUMN_GRANT_ID");
 
-ALTER TABLE "APP"."SERDE_PARAMS" ADD CONSTRAINT "SERDE_PARAMS_PK" PRIMARY KEY ("SERDE_ID", "PARAM_KEY");
+ALTER TABLE "APP"."CDS" ADD CONSTRAINT "SQL110922153006460" PRIMARY KEY ("CD_ID");
 
-ALTER TABLE "APP"."REGION_SDS" ADD CONSTRAINT "SQL120210122103870" PRIMARY KEY ("SD_ID", "REGION_NAME");
+ALTER TABLE "APP"."DB_PRIVS" ADD CONSTRAINT "DB_PRIVS_PK" PRIMARY KEY ("DB_GRANT_ID");
 
-ALTER TABLE "APP"."PARTITIONS" ADD CONSTRAINT "PARTITIONS_PK" PRIMARY KEY ("PART_ID");
+ALTER TABLE "APP"."INDEX_PARAMS" ADD CONSTRAINT "INDEX_PARAMS_PK" PRIMARY KEY ("INDEX_ID", "PARAM_KEY");
 
-ALTER TABLE "APP"."COLUMNS" ADD CONSTRAINT "COLUMNS_PK" PRIMARY KEY ("SD_ID", "COLUMN_NAME");
+ALTER TABLE "APP"."PARTITION_KEYS" ADD CONSTRAINT "PARTITION_KEY_PK" PRIMARY KEY ("TBL_ID", "PKEY_NAME");
 
-ALTER TABLE "APP"."BUCKETING_COLS" ADD CONSTRAINT "BUCKETING_COLS_PK" PRIMARY KEY ("SD_ID", "INTEGER_IDX");
+ALTER TABLE "APP"."SEQUENCE_TABLE" ADD CONSTRAINT "SEQUENCE_TABLE_PK" PRIMARY KEY ("SEQUENCE_NAME");
 
-ALTER TABLE "APP"."CDS" ADD CONSTRAINT "SQL110922153006460" PRIMARY KEY ("CD_ID");
+ALTER TABLE "APP"."PART_PRIVS" ADD CONSTRAINT "PART_PRIVS_PK" PRIMARY KEY ("PART_GRANT_ID");
 
-ALTER TABLE "APP"."ROLE_MAP" ADD CONSTRAINT "ROLE_MAP_PK" PRIMARY KEY ("ROLE_GRANT_ID");
+ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SDS_PK" PRIMARY KEY ("SD_ID");
 
-ALTER TABLE "APP"."PARTITION_KEYS" ADD CONSTRAINT "PARTITION_KEY_PK" PRIMARY KEY ("TBL_ID", "PKEY_NAME");
+ALTER TABLE "APP"."SERDES" ADD CONSTRAINT "SERDES_PK" PRIMARY KEY ("SERDE_ID");
 
-ALTER TABLE "APP"."SD_PARAMS" ADD CONSTRAINT "SD_PARAMS_PK" PRIMARY KEY ("SD_ID", "PARAM_KEY");
+ALTER TABLE "APP"."COLUMNS" ADD CONSTRAINT "COLUMNS_PK" PRIMARY KEY ("SD_ID", "COLUMN_NAME");
 
-ALTER TABLE "APP"."DATABASE_PARAMS" ADD CONSTRAINT "DATABASE_PARAMS_PK" PRIMARY KEY ("DB_ID", "PARAM_KEY");
+ALTER TABLE "APP"."PARTITION_EVENTS" ADD CONSTRAINT "PARTITION_EVENTS_PK" PRIMARY KEY ("PART_NAME_ID");
 
-ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_PK" PRIMARY KEY ("INDEX_ID");
+ALTER TABLE "APP"."TYPE_FIELDS" ADD CONSTRAINT "TYPE_FIELDS_PK" PRIMARY KEY ("TYPE_NAME", "FIELD_NAME");
 
-ALTER TABLE "APP"."PARTITION_PARAMS" ADD CONSTRAINT "PARTITION_PARAMS_PK" PRIMARY KEY ("PART_ID", "PARAM_KEY");
+ALTER TABLE "APP"."ROLES" ADD CONSTRAINT "ROLES_PK" PRIMARY KEY ("ROLE_ID");
 
-ALTER TABLE "APP"."SEQUENCE_TABLE" ADD CONSTRAINT "SEQUENCE_TABLE_PK" PRIMARY KEY ("SEQUENCE_NAME");
+ALTER TABLE "APP"."TBL_PRIVS" ADD CONSTRAINT "TBL_PRIVS_PK" PRIMARY KEY ("TBL_GRANT_ID");
 
-ALTER TABLE "APP"."COLUMNS_V2" ADD CONSTRAINT "SQL110922153006740" PRIMARY KEY ("CD_ID", "COLUMN_NAME");
+ALTER TABLE "APP"."SERDE_PARAMS" ADD CONSTRAINT "SERDE_PARAMS_PK" PRIMARY KEY ("SERDE_ID", "PARAM_KEY");
 
-ALTER TABLE "APP"."SERDES" ADD CONSTRAINT "SERDES_PK" PRIMARY KEY ("SERDE_ID");
+ALTER TABLE "APP"."NUCLEUS_TABLES" ADD CONSTRAINT "NUCLEUS_TABLES_PK" PRIMARY KEY ("CLASS_NAME");
 
-ALTER TABLE "APP"."ROLES" ADD CONSTRAINT "ROLES_PK" PRIMARY KEY ("ROLE_ID");
+ALTER TABLE "APP"."TBLS" ADD CONSTRAINT "TBLS_PK" PRIMARY KEY ("TBL_ID");
 
-ALTER TABLE "APP"."TYPE_FIELDS" ADD CONSTRAINT "TYPE_FIELDS_PK" PRIMARY KEY ("TYPE_NAME", "FIELD_NAME");
+ALTER TABLE "APP"."SD_PARAMS" ADD CONSTRAINT "SD_PARAMS_PK" PRIMARY KEY ("SD_ID", "PARAM_KEY");
+
+ALTER TABLE "APP"."DATABASE_PARAMS" ADD CONSTRAINT "DATABASE_PARAMS_PK" PRIMARY KEY ("DB_ID", "PARAM_KEY");
 
 ALTER TABLE "APP"."DBS" ADD CONSTRAINT "DBS_PK" PRIMARY KEY ("DB_ID");
 
+ALTER TABLE "APP"."ROLE_MAP" ADD CONSTRAINT "ROLE_MAP_PK" PRIMARY KEY ("ROLE_GRANT_ID");
+
+ALTER TABLE "APP"."GLOBAL_PRIVS" ADD CONSTRAINT "GLOBAL_PRIVS_PK" PRIMARY KEY ("USER_GRANT_ID");
+
+ALTER TABLE "APP"."BUCKETING_COLS" ADD CONSTRAINT "BUCKETING_COLS_PK" PRIMARY KEY ("SD_ID", "INTEGER_IDX");
+
+ALTER TABLE "APP"."SORT_COLS" ADD CONSTRAINT "SORT_COLS_PK" PRIMARY KEY ("SD_ID", "INTEGER_IDX");
+
 ALTER TABLE "APP"."PARTITION_KEY_VALS" ADD CONSTRAINT "PARTITION_KEY_VALS_PK" PRIMARY KEY ("PART_ID", "INTEGER_IDX");
 
 ALTER TABLE "APP"."TYPES" ADD CONSTRAINT "TYPES_PK" PRIMARY KEY ("TYPES_ID");
 
-ALTER TABLE "APP"."PART_COL_PRIVS" ADD CONSTRAINT "PART_COL_PRIVS_PK" PRIMARY KEY ("PART_COLUMN_GRANT_ID");
+ALTER TABLE "APP"."COLUMNS_V2" ADD CONSTRAINT "SQL110922153006740" PRIMARY KEY ("CD_ID", "COLUMN_NAME");
 
-ALTER TABLE "APP"."TBL_COL_PRIVS" ADD CONSTRAINT "TBL_COL_PRIVS_PK" PRIMARY KEY ("TBL_COLUMN_GRANT_ID");
+ALTER TABLE "APP"."PART_COL_PRIVS" ADD CONSTRAINT "PART_COL_PRIVS_PK" PRIMARY KEY ("PART_COLUMN_GRANT_ID");
 
-ALTER TABLE "APP"."INDEX_PARAMS" ADD CONSTRAINT "INDEX_PARAMS_PK" PRIMARY KEY ("INDEX_ID", "PARAM_KEY");
+ALTER TABLE "APP"."PARTITION_PARAMS" ADD CONSTRAINT "PARTITION_PARAMS_PK" PRIMARY KEY ("PART_ID", "PARAM_KEY");
 
-ALTER TABLE "APP"."PARTITION_EVENTS" ADD CONSTRAINT "PARTITION_EVENTS_PK" PRIMARY KEY ("PART_NAME_ID");
+ALTER TABLE "APP"."PARTITIONS" ADD CONSTRAINT "PARTITIONS_PK" PRIMARY KEY ("PART_ID");
 
 ALTER TABLE "APP"."TABLE_PARAMS" ADD CONSTRAINT "TABLE_PARAMS_PK" PRIMARY KEY ("TBL_ID", "PARAM_KEY");
 
-ALTER TABLE "APP"."SORT_COLS" ADD CONSTRAINT "SORT_COLS_PK" PRIMARY KEY ("SD_ID", "INTEGER_IDX");
+-- foreign
+ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_FK1" FOREIGN KEY ("ORIG_TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."PART_PRIVS" ADD CONSTRAINT "PART_PRIVS_PK" PRIMARY KEY ("PART_GRANT_ID");
+ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_FK2" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."TBLS" ADD CONSTRAINT "TBLS_PK" PRIMARY KEY ("TBL_ID");
+ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_FK3" FOREIGN KEY ("INDEX_TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."NUCLEUS_TABLES" ADD CONSTRAINT "NUCLEUS_TABLES_PK" PRIMARY KEY ("CLASS_NAME");
+ALTER TABLE "APP"."TBL_COL_PRIVS" ADD CONSTRAINT "TBL_COL_PRIVS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."TBL_PRIVS" ADD CONSTRAINT "TBL_PRIVS_PK" PRIMARY KEY ("TBL_GRANT_ID");
+ALTER TABLE "APP"."DB_PRIVS" ADD CONSTRAINT "DB_PRIVS_FK1" FOREIGN KEY ("DB_ID") REFERENCES "APP"."DBS" ("DB_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."DB_PRIVS" ADD CONSTRAINT "DB_PRIVS_PK" PRIMARY KEY ("DB_GRANT_ID");
+ALTER TABLE "APP"."INDEX_PARAMS" ADD CONSTRAINT "INDEX_PARAMS_FK1" FOREIGN KEY ("INDEX_ID") REFERENCES "APP"."IDXS" ("INDEX_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
--- foreign
-ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SDS_FK1" FOREIGN KEY ("SERDE_ID") REFERENCES "APP"."SERDES" ("SERDE_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."PARTITION_KEYS" ADD CONSTRAINT "PARTITION_KEYS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SDS_FK2" FOREIGN KEY ("CD_ID") REFERENCES "APP"."CDS" ("CD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."PART_PRIVS" ADD CONSTRAINT "PART_PRIVS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."SERDE_PARAMS" ADD CONSTRAINT "SERDE_PARAMS_FK1" FOREIGN KEY ("SERDE_ID") REFERENCES "APP"."SERDES" ("SERDE_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SDS_FK1" FOREIGN KEY ("SERDE_ID") REFERENCES "APP"."SERDES" ("SERDE_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."REGION_SDS" ADD CONSTRAINT "REGION_SDS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SDS_FK2" FOREIGN KEY ("CD_ID") REFERENCES "APP"."CDS" ("CD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."PARTITIONS" ADD CONSTRAINT "PARTITIONS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."COLUMNS" ADD CONSTRAINT "COLUMNS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."PARTITIONS" ADD CONSTRAINT "PARTITIONS_FK2" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."TYPE_FIELDS" ADD CONSTRAINT "TYPE_FIELDS_FK1" FOREIGN KEY ("TYPE_NAME") REFERENCES "APP"."TYPES" ("TYPES_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."COLUMNS" ADD CONSTRAINT "COLUMNS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."TBL_PRIVS" ADD CONSTRAINT "TBL_PRIVS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."BUCKETING_COLS" ADD CONSTRAINT "BUCKETING_COLS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."SERDE_PARAMS" ADD CONSTRAINT "SERDE_PARAMS_FK1" FOREIGN KEY ("SERDE_ID") REFERENCES "APP"."SERDES" ("SERDE_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."ROLE_MAP" ADD CONSTRAINT "ROLE_MAP_FK1" FOREIGN KEY ("ROLE_ID") REFERENCES "APP"."ROLES" ("ROLE_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."TBLS" ADD CONSTRAINT "TBLS_FK2" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."PARTITION_KEYS" ADD CONSTRAINT "PARTITION_KEYS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."TBLS" ADD CONSTRAINT "TBLS_FK1" FOREIGN KEY ("DB_ID") REFERENCES "APP"."DBS" ("DB_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
 ALTER TABLE "APP"."SD_PARAMS" ADD CONSTRAINT "SD_PARAMS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
 ALTER TABLE "APP"."DATABASE_PARAMS" ADD CONSTRAINT "DATABASE_PARAMS_FK1" FOREIGN KEY ("DB_ID") REFERENCES "APP"."DBS" ("DB_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_FK1" FOREIGN KEY ("ORIG_TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."ROLE_MAP" ADD CONSTRAINT "ROLE_MAP_FK1" FOREIGN KEY ("ROLE_ID") REFERENCES "APP"."ROLES" ("ROLE_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_FK2" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."BUCKETING_COLS" ADD CONSTRAINT "BUCKETING_COLS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "IDXS_FK3" FOREIGN KEY ("INDEX_TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."SORT_COLS" ADD CONSTRAINT "SORT_COLS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."PARTITION_PARAMS" ADD CONSTRAINT "PARTITION_PARAMS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."PARTITION_KEY_VALS" ADD CONSTRAINT "PARTITION_KEY_VALS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
 ALTER TABLE "APP"."COLUMNS_V2" ADD CONSTRAINT "COLUMNS_V2_FK1" FOREIGN KEY ("CD_ID") REFERENCES "APP"."CDS" ("CD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."TYPE_FIELDS" ADD CONSTRAINT "TYPE_FIELDS_FK1" FOREIGN KEY ("TYPE_NAME") REFERENCES "APP"."TYPES" ("TYPES_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
-
-ALTER TABLE "APP"."PARTITION_KEY_VALS" ADD CONSTRAINT "PARTITION_KEY_VALS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
-
 ALTER TABLE "APP"."PART_COL_PRIVS" ADD CONSTRAINT "PART_COL_PRIVS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."TBL_COL_PRIVS" ADD CONSTRAINT "TBL_COL_PRIVS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
-
-ALTER TABLE "APP"."INDEX_PARAMS" ADD CONSTRAINT "INDEX_PARAMS_FK1" FOREIGN KEY ("INDEX_ID") REFERENCES "APP"."IDXS" ("INDEX_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
-
-ALTER TABLE "APP"."TABLE_PARAMS" ADD CONSTRAINT "TABLE_PARAMS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
-
-ALTER TABLE "APP"."SORT_COLS" ADD CONSTRAINT "SORT_COLS_FK1" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
-
-ALTER TABLE "APP"."PART_PRIVS" ADD CONSTRAINT "PART_PRIVS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
-
-ALTER TABLE "APP"."TBLS" ADD CONSTRAINT "TBLS_FK2" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."PARTITION_PARAMS" ADD CONSTRAINT "PARTITION_PARAMS_FK1" FOREIGN KEY ("PART_ID") REFERENCES "APP"."PARTITIONS" ("PART_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."TBLS" ADD CONSTRAINT "TBLS_FK1" FOREIGN KEY ("DB_ID") REFERENCES "APP"."DBS" ("DB_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."PARTITIONS" ADD CONSTRAINT "PARTITIONS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."TBL_PRIVS" ADD CONSTRAINT "TBL_PRIVS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."PARTITIONS" ADD CONSTRAINT "PARTITIONS_FK2" FOREIGN KEY ("SD_ID") REFERENCES "APP"."SDS" ("SD_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
-ALTER TABLE "APP"."DB_PRIVS" ADD CONSTRAINT "DB_PRIVS_FK1" FOREIGN KEY ("DB_ID") REFERENCES "APP"."DBS" ("DB_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
+ALTER TABLE "APP"."TABLE_PARAMS" ADD CONSTRAINT "TABLE_PARAMS_FK1" FOREIGN KEY ("TBL_ID") REFERENCES "APP"."TBLS" ("TBL_ID") ON DELETE NO ACTION ON UPDATE NO ACTION;
 
 -- ----------------------------------------------
 -- DDL Statements for checks
 -- ----------------------------------------------
 
-ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SQL110318025505550" CHECK (IS_COMPRESSED IN ('Y','N'));
-
 ALTER TABLE "APP"."IDXS" ADD CONSTRAINT "SQL110318025504980" CHECK (DEFERRED_REBUILD IN ('Y','N'));
 
+ALTER TABLE "APP"."SDS" ADD CONSTRAINT "SQL110318025505550" CHECK (IS_COMPRESSED IN ('Y','N'));
+

Modified: hive/branches/branch-0.9/metastore/scripts/upgrade/derby/upgrade-0.8.0-to-0.9.0.derby.sql
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/metastore/scripts/upgrade/derby/upgrade-0.8.0-to-0.9.0.derby.sql?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/metastore/scripts/upgrade/derby/upgrade-0.8.0-to-0.9.0.derby.sql (original)
+++ hive/branches/branch-0.9/metastore/scripts/upgrade/derby/upgrade-0.8.0-to-0.9.0.derby.sql Fri Apr 20 18:16:12 2012
@@ -1,2 +1,2 @@
 -- Upgrade MetaStore schema from 0.8.0 to 0.9.0
-RUN '009-HIVE-2612.derby.sql';
+

Modified: hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/hive-schema-0.9.0.mysql.sql
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/hive-schema-0.9.0.mysql.sql?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/hive-schema-0.9.0.mysql.sql (original)
+++ hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/hive-schema-0.9.0.mysql.sql Fri Apr 20 18:16:12 2012
@@ -1,8 +1,8 @@
--- MySQL dump 10.13  Distrib 5.1.53, for redhat-linux-gnu (x86_64)
+-- MySQL dump 10.13  Distrib 5.1.54, for debian-linux-gnu (x86_64)
 --
--- Host: cdb259.snc1    Database: test_kevinwilfong_metastore
+-- Host: localhost    Database: mdb
 -- ------------------------------------------------------
--- Server version	5.1.47_blackhole_memcache-log
+-- Server version	5.1.54-1ubuntu4
 
 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -19,10 +19,9 @@
 -- Table structure for table `BUCKETING_COLS`
 --
 
-DROP TABLE IF EXISTS `BUCKETING_COLS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `BUCKETING_COLS` (
+CREATE TABLE IF NOT EXISTS `BUCKETING_COLS` (
   `SD_ID` bigint(20) NOT NULL,
   `BUCKET_COL_NAME` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `INTEGER_IDX` int(11) NOT NULL,
@@ -36,10 +35,9 @@ CREATE TABLE `BUCKETING_COLS` (
 -- Table structure for table `CDS`
 --
 
-DROP TABLE IF EXISTS `CDS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `CDS` (
+CREATE TABLE IF NOT EXISTS `CDS` (
   `CD_ID` bigint(20) NOT NULL,
   PRIMARY KEY (`CD_ID`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@@ -49,10 +47,9 @@ CREATE TABLE `CDS` (
 -- Table structure for table `COLUMNS_V2`
 --
 
-DROP TABLE IF EXISTS `COLUMNS_V2`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `COLUMNS_V2` (
+CREATE TABLE IF NOT EXISTS `COLUMNS_V2` (
   `CD_ID` bigint(20) NOT NULL,
   `COMMENT` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `COLUMN_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
@@ -68,10 +65,9 @@ CREATE TABLE `COLUMNS_V2` (
 -- Table structure for table `DATABASE_PARAMS`
 --
 
-DROP TABLE IF EXISTS `DATABASE_PARAMS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `DATABASE_PARAMS` (
+CREATE TABLE IF NOT EXISTS `DATABASE_PARAMS` (
   `DB_ID` bigint(20) NOT NULL,
   `PARAM_KEY` varchar(180) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `PARAM_VALUE` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -85,10 +81,9 @@ CREATE TABLE `DATABASE_PARAMS` (
 -- Table structure for table `DBS`
 --
 
-DROP TABLE IF EXISTS `DBS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `DBS` (
+CREATE TABLE IF NOT EXISTS `DBS` (
   `DB_ID` bigint(20) NOT NULL,
   `DESC` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `DB_LOCATION_URI` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
@@ -102,10 +97,9 @@ CREATE TABLE `DBS` (
 -- Table structure for table `DB_PRIVS`
 --
 
-DROP TABLE IF EXISTS `DB_PRIVS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `DB_PRIVS` (
+CREATE TABLE IF NOT EXISTS `DB_PRIVS` (
   `DB_GRANT_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `DB_ID` bigint(20) DEFAULT NULL,
@@ -126,10 +120,9 @@ CREATE TABLE `DB_PRIVS` (
 -- Table structure for table `GLOBAL_PRIVS`
 --
 
-DROP TABLE IF EXISTS `GLOBAL_PRIVS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `GLOBAL_PRIVS` (
+CREATE TABLE IF NOT EXISTS `GLOBAL_PRIVS` (
   `USER_GRANT_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `GRANT_OPTION` smallint(6) NOT NULL,
@@ -147,10 +140,9 @@ CREATE TABLE `GLOBAL_PRIVS` (
 -- Table structure for table `IDXS`
 --
 
-DROP TABLE IF EXISTS `IDXS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `IDXS` (
+CREATE TABLE IF NOT EXISTS `IDXS` (
   `INDEX_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `DEFERRED_REBUILD` bit(1) NOT NULL,
@@ -175,10 +167,9 @@ CREATE TABLE `IDXS` (
 -- Table structure for table `INDEX_PARAMS`
 --
 
-DROP TABLE IF EXISTS `INDEX_PARAMS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `INDEX_PARAMS` (
+CREATE TABLE IF NOT EXISTS `INDEX_PARAMS` (
   `INDEX_ID` bigint(20) NOT NULL,
   `PARAM_KEY` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `PARAM_VALUE` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -192,10 +183,9 @@ CREATE TABLE `INDEX_PARAMS` (
 -- Table structure for table `NUCLEUS_TABLES`
 --
 
-DROP TABLE IF EXISTS `NUCLEUS_TABLES`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `NUCLEUS_TABLES` (
+CREATE TABLE IF NOT EXISTS `NUCLEUS_TABLES` (
   `CLASS_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `TABLE_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `TYPE` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
@@ -210,10 +200,9 @@ CREATE TABLE `NUCLEUS_TABLES` (
 -- Table structure for table `PARTITIONS`
 --
 
-DROP TABLE IF EXISTS `PARTITIONS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `PARTITIONS` (
+CREATE TABLE IF NOT EXISTS `PARTITIONS` (
   `PART_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `LAST_ACCESS_TIME` int(11) NOT NULL,
@@ -233,10 +222,9 @@ CREATE TABLE `PARTITIONS` (
 -- Table structure for table `PARTITION_EVENTS`
 --
 
-DROP TABLE IF EXISTS `PARTITION_EVENTS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `PARTITION_EVENTS` (
+CREATE TABLE IF NOT EXISTS `PARTITION_EVENTS` (
   `PART_NAME_ID` bigint(20) NOT NULL,
   `DB_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `EVENT_TIME` bigint(20) NOT NULL,
@@ -252,10 +240,9 @@ CREATE TABLE `PARTITION_EVENTS` (
 -- Table structure for table `PARTITION_KEYS`
 --
 
-DROP TABLE IF EXISTS `PARTITION_KEYS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `PARTITION_KEYS` (
+CREATE TABLE IF NOT EXISTS `PARTITION_KEYS` (
   `TBL_ID` bigint(20) NOT NULL,
   `PKEY_COMMENT` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `PKEY_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
@@ -271,10 +258,9 @@ CREATE TABLE `PARTITION_KEYS` (
 -- Table structure for table `PARTITION_KEY_VALS`
 --
 
-DROP TABLE IF EXISTS `PARTITION_KEY_VALS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `PARTITION_KEY_VALS` (
+CREATE TABLE IF NOT EXISTS `PARTITION_KEY_VALS` (
   `PART_ID` bigint(20) NOT NULL,
   `PART_KEY_VAL` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `INTEGER_IDX` int(11) NOT NULL,
@@ -288,10 +274,9 @@ CREATE TABLE `PARTITION_KEY_VALS` (
 -- Table structure for table `PARTITION_PARAMS`
 --
 
-DROP TABLE IF EXISTS `PARTITION_PARAMS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `PARTITION_PARAMS` (
+CREATE TABLE IF NOT EXISTS `PARTITION_PARAMS` (
   `PART_ID` bigint(20) NOT NULL,
   `PARAM_KEY` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `PARAM_VALUE` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -305,10 +290,9 @@ CREATE TABLE `PARTITION_PARAMS` (
 -- Table structure for table `PART_COL_PRIVS`
 --
 
-DROP TABLE IF EXISTS `PART_COL_PRIVS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `PART_COL_PRIVS` (
+CREATE TABLE IF NOT EXISTS `PART_COL_PRIVS` (
   `PART_COLUMN_GRANT_ID` bigint(20) NOT NULL,
   `COLUMN_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `CREATE_TIME` int(11) NOT NULL,
@@ -330,10 +314,9 @@ CREATE TABLE `PART_COL_PRIVS` (
 -- Table structure for table `PART_PRIVS`
 --
 
-DROP TABLE IF EXISTS `PART_PRIVS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `PART_PRIVS` (
+CREATE TABLE IF NOT EXISTS `PART_PRIVS` (
   `PART_GRANT_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `GRANT_OPTION` smallint(6) NOT NULL,
@@ -351,30 +334,12 @@ CREATE TABLE `PART_PRIVS` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
--- Table structure for table `REGION_SDS`
---
-
-DROP TABLE IF EXISTS `REGION_SDS`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `REGION_SDS` (
-  `SD_ID` bigint(20) NOT NULL,
-  `REGION_NAME` varchar(512) NOT NULL,
-  `LOCATION` varchar(4000) DEFAULT NULL,
-  PRIMARY KEY (`SD_ID`,`REGION_NAME`),
-  KEY `REGION_SDS_N49` (`SD_ID`),
-  CONSTRAINT `REGION_SDS_V2_FK1` FOREIGN KEY (`SD_ID`) REFERENCES `SDS` (`SD_ID`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
 -- Table structure for table `ROLES`
 --
 
-DROP TABLE IF EXISTS `ROLES`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `ROLES` (
+CREATE TABLE IF NOT EXISTS `ROLES` (
   `ROLE_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `OWNER_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -388,10 +353,9 @@ CREATE TABLE `ROLES` (
 -- Table structure for table `ROLE_MAP`
 --
 
-DROP TABLE IF EXISTS `ROLE_MAP`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `ROLE_MAP` (
+CREATE TABLE IF NOT EXISTS `ROLE_MAP` (
   `ROLE_GRANT_ID` bigint(20) NOT NULL,
   `ADD_TIME` int(11) NOT NULL,
   `GRANT_OPTION` smallint(6) NOT NULL,
@@ -411,10 +375,9 @@ CREATE TABLE `ROLE_MAP` (
 -- Table structure for table `SDS`
 --
 
-DROP TABLE IF EXISTS `SDS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `SDS` (
+CREATE TABLE IF NOT EXISTS `SDS` (
   `SD_ID` bigint(20) NOT NULL,
   `CD_ID` bigint(20) DEFAULT NULL,
   `INPUT_FORMAT` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -423,7 +386,6 @@ CREATE TABLE `SDS` (
   `NUM_BUCKETS` int(11) NOT NULL,
   `OUTPUT_FORMAT` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `SERDE_ID` bigint(20) DEFAULT NULL,
-  `PRIMARY_REGION_NAME` varchar(512) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
   PRIMARY KEY (`SD_ID`),
   KEY `SDS_N49` (`SERDE_ID`),
   KEY `SDS_N50` (`CD_ID`),
@@ -436,10 +398,9 @@ CREATE TABLE `SDS` (
 -- Table structure for table `SD_PARAMS`
 --
 
-DROP TABLE IF EXISTS `SD_PARAMS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `SD_PARAMS` (
+CREATE TABLE IF NOT EXISTS `SD_PARAMS` (
   `SD_ID` bigint(20) NOT NULL,
   `PARAM_KEY` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `PARAM_VALUE` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -453,10 +414,9 @@ CREATE TABLE `SD_PARAMS` (
 -- Table structure for table `SEQUENCE_TABLE`
 --
 
-DROP TABLE IF EXISTS `SEQUENCE_TABLE`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `SEQUENCE_TABLE` (
+CREATE TABLE IF NOT EXISTS `SEQUENCE_TABLE` (
   `SEQUENCE_NAME` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `NEXT_VAL` bigint(20) NOT NULL,
   PRIMARY KEY (`SEQUENCE_NAME`)
@@ -467,10 +427,9 @@ CREATE TABLE `SEQUENCE_TABLE` (
 -- Table structure for table `SERDES`
 --
 
-DROP TABLE IF EXISTS `SERDES`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `SERDES` (
+CREATE TABLE IF NOT EXISTS `SERDES` (
   `SERDE_ID` bigint(20) NOT NULL,
   `NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `SLIB` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -482,10 +441,9 @@ CREATE TABLE `SERDES` (
 -- Table structure for table `SERDE_PARAMS`
 --
 
-DROP TABLE IF EXISTS `SERDE_PARAMS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `SERDE_PARAMS` (
+CREATE TABLE IF NOT EXISTS `SERDE_PARAMS` (
   `SERDE_ID` bigint(20) NOT NULL,
   `PARAM_KEY` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `PARAM_VALUE` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -499,10 +457,9 @@ CREATE TABLE `SERDE_PARAMS` (
 -- Table structure for table `SORT_COLS`
 --
 
-DROP TABLE IF EXISTS `SORT_COLS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `SORT_COLS` (
+CREATE TABLE IF NOT EXISTS `SORT_COLS` (
   `SD_ID` bigint(20) NOT NULL,
   `COLUMN_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `ORDER` int(11) NOT NULL,
@@ -517,10 +474,9 @@ CREATE TABLE `SORT_COLS` (
 -- Table structure for table `TABLE_PARAMS`
 --
 
-DROP TABLE IF EXISTS `TABLE_PARAMS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `TABLE_PARAMS` (
+CREATE TABLE IF NOT EXISTS `TABLE_PARAMS` (
   `TBL_ID` bigint(20) NOT NULL,
   `PARAM_KEY` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
   `PARAM_VALUE` varchar(4000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -534,10 +490,9 @@ CREATE TABLE `TABLE_PARAMS` (
 -- Table structure for table `TBLS`
 --
 
-DROP TABLE IF EXISTS `TBLS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `TBLS` (
+CREATE TABLE IF NOT EXISTS `TBLS` (
   `TBL_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `DB_ID` bigint(20) DEFAULT NULL,
@@ -562,10 +517,9 @@ CREATE TABLE `TBLS` (
 -- Table structure for table `TBL_COL_PRIVS`
 --
 
-DROP TABLE IF EXISTS `TBL_COL_PRIVS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `TBL_COL_PRIVS` (
+CREATE TABLE IF NOT EXISTS `TBL_COL_PRIVS` (
   `TBL_COLUMN_GRANT_ID` bigint(20) NOT NULL,
   `COLUMN_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `CREATE_TIME` int(11) NOT NULL,
@@ -587,10 +541,9 @@ CREATE TABLE `TBL_COL_PRIVS` (
 -- Table structure for table `TBL_PRIVS`
 --
 
-DROP TABLE IF EXISTS `TBL_PRIVS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `TBL_PRIVS` (
+CREATE TABLE IF NOT EXISTS `TBL_PRIVS` (
   `TBL_GRANT_ID` bigint(20) NOT NULL,
   `CREATE_TIME` int(11) NOT NULL,
   `GRANT_OPTION` smallint(6) NOT NULL,
@@ -611,10 +564,9 @@ CREATE TABLE `TBL_PRIVS` (
 -- Table structure for table `TYPES`
 --
 
-DROP TABLE IF EXISTS `TYPES`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `TYPES` (
+CREATE TABLE IF NOT EXISTS `TYPES` (
   `TYPES_ID` bigint(20) NOT NULL,
   `TYPE_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `TYPE1` varchar(767) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
@@ -628,10 +580,9 @@ CREATE TABLE `TYPES` (
 -- Table structure for table `TYPE_FIELDS`
 --
 
-DROP TABLE IF EXISTS `TYPE_FIELDS`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `TYPE_FIELDS` (
+CREATE TABLE IF NOT EXISTS `TYPE_FIELDS` (
   `TYPE_NAME` bigint(20) NOT NULL,
   `COMMENT` varchar(256) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
   `FIELD_NAME` varchar(128) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
@@ -652,4 +603,4 @@ CREATE TABLE `TYPE_FIELDS` (
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 
--- Dump completed on 2012-02-10 12:02:33
+-- Dump completed on 2011-09-22 13:31:46

Modified: hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/upgrade-0.8.0-to-0.9.0.mysql.sql
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/upgrade-0.8.0-to-0.9.0.mysql.sql?rev=1328473&r1=1328472&r2=1328473&view=diff
==============================================================================
--- hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/upgrade-0.8.0-to-0.9.0.mysql.sql (original)
+++ hive/branches/branch-0.9/metastore/scripts/upgrade/mysql/upgrade-0.8.0-to-0.9.0.mysql.sql Fri Apr 20 18:16:12 2012
@@ -1,3 +1,2 @@
 SELECT 'Upgrading MetaStore schema from 0.8.0 to 0.9.0' AS ' ';
-SOURCE 009-HIVE-2612.mysql.sql;
 SELECT 'Finished upgrading MetaStore schema from 0.8.0 to 0.9.0' AS ' ';



Mime
View raw message