hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r980659 [7/34] - in /hadoop/hive/trunk: ./ common/src/java/org/apache/hadoop/hive/common/ contrib/src/test/results/clientpositive/ metastore/if/ metastore/src/gen-cpp/ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ metasto...
Date Fri, 30 Jul 2010 06:40:11 GMT
Modified: hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py?rev=980659&r1=980658&r2=980659&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py (original)
+++ hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ThriftHiveMetastore.py Fri Jul 30 06:40:04 2010
@@ -262,6 +262,51 @@ class Iface(fb303.FacebookService.Iface)
     """
     pass
 
+  def add_index(self, new_index, index_table):
+    """
+    Parameters:
+     - new_index
+     - index_table
+    """
+    pass
+
+  def drop_index_by_name(self, db_name, tbl_name, index_name, deleteData):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - index_name
+     - deleteData
+    """
+    pass
+
+  def get_index_by_name(self, db_name, tbl_name, index_name):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - index_name
+    """
+    pass
+
+  def get_indexes(self, db_name, tbl_name, max_indexes):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - max_indexes
+    """
+    pass
+
+  def get_index_names(self, db_name, tbl_name, max_indexes):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - max_indexes
+    """
+    pass
+
 
 class Client(fb303.FacebookService.Client, Iface):
   """
@@ -1341,6 +1386,196 @@ class Client(fb303.FacebookService.Clien
       raise result.o1
     raise TApplicationException(TApplicationException.MISSING_RESULT, "partition_name_to_spec failed: unknown result");
 
+  def add_index(self, new_index, index_table):
+    """
+    Parameters:
+     - new_index
+     - index_table
+    """
+    self.send_add_index(new_index, index_table)
+    return self.recv_add_index()
+
+  def send_add_index(self, new_index, index_table):
+    self._oprot.writeMessageBegin('add_index', TMessageType.CALL, self._seqid)
+    args = add_index_args()
+    args.new_index = new_index
+    args.index_table = index_table
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_add_index(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = add_index_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    if result.o3 != None:
+      raise result.o3
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "add_index failed: unknown result");
+
+  def drop_index_by_name(self, db_name, tbl_name, index_name, deleteData):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - index_name
+     - deleteData
+    """
+    self.send_drop_index_by_name(db_name, tbl_name, index_name, deleteData)
+    return self.recv_drop_index_by_name()
+
+  def send_drop_index_by_name(self, db_name, tbl_name, index_name, deleteData):
+    self._oprot.writeMessageBegin('drop_index_by_name', TMessageType.CALL, self._seqid)
+    args = drop_index_by_name_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.index_name = index_name
+    args.deleteData = deleteData
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_drop_index_by_name(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = drop_index_by_name_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "drop_index_by_name failed: unknown result");
+
+  def get_index_by_name(self, db_name, tbl_name, index_name):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - index_name
+    """
+    self.send_get_index_by_name(db_name, tbl_name, index_name)
+    return self.recv_get_index_by_name()
+
+  def send_get_index_by_name(self, db_name, tbl_name, index_name):
+    self._oprot.writeMessageBegin('get_index_by_name', TMessageType.CALL, self._seqid)
+    args = get_index_by_name_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.index_name = index_name
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_index_by_name(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_index_by_name_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_index_by_name failed: unknown result");
+
+  def get_indexes(self, db_name, tbl_name, max_indexes):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - max_indexes
+    """
+    self.send_get_indexes(db_name, tbl_name, max_indexes)
+    return self.recv_get_indexes()
+
+  def send_get_indexes(self, db_name, tbl_name, max_indexes):
+    self._oprot.writeMessageBegin('get_indexes', TMessageType.CALL, self._seqid)
+    args = get_indexes_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.max_indexes = max_indexes
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_indexes(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_indexes_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o1 != None:
+      raise result.o1
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_indexes failed: unknown result");
+
+  def get_index_names(self, db_name, tbl_name, max_indexes):
+    """
+    Parameters:
+     - db_name
+     - tbl_name
+     - max_indexes
+    """
+    self.send_get_index_names(db_name, tbl_name, max_indexes)
+    return self.recv_get_index_names()
+
+  def send_get_index_names(self, db_name, tbl_name, max_indexes):
+    self._oprot.writeMessageBegin('get_index_names', TMessageType.CALL, self._seqid)
+    args = get_index_names_args()
+    args.db_name = db_name
+    args.tbl_name = tbl_name
+    args.max_indexes = max_indexes
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_get_index_names(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = get_index_names_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success != None:
+      return result.success
+    if result.o2 != None:
+      raise result.o2
+    raise TApplicationException(TApplicationException.MISSING_RESULT, "get_index_names failed: unknown result");
+
 
 class Processor(fb303.FacebookService.Processor, Iface, TProcessor):
   def __init__(self, handler):
@@ -1375,6 +1610,11 @@ class Processor(fb303.FacebookService.Pr
     self._processMap["get_config_value"] = Processor.process_get_config_value
     self._processMap["partition_name_to_vals"] = Processor.process_partition_name_to_vals
     self._processMap["partition_name_to_spec"] = Processor.process_partition_name_to_spec
+    self._processMap["add_index"] = Processor.process_add_index
+    self._processMap["drop_index_by_name"] = Processor.process_drop_index_by_name
+    self._processMap["get_index_by_name"] = Processor.process_get_index_by_name
+    self._processMap["get_indexes"] = Processor.process_get_indexes
+    self._processMap["get_index_names"] = Processor.process_get_index_names
 
   def process(self, iprot, oprot):
     (name, type, seqid) = iprot.readMessageBegin()
@@ -1863,6 +2103,86 @@ class Processor(fb303.FacebookService.Pr
     oprot.writeMessageEnd()
     oprot.trans.flush()
 
+  def process_add_index(self, seqid, iprot, oprot):
+    args = add_index_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = add_index_result()
+    try:
+      result.success = self._handler.add_index(args.new_index, args.index_table)
+    except InvalidObjectException, o1:
+      result.o1 = o1
+    except AlreadyExistsException, o2:
+      result.o2 = o2
+    except MetaException, o3:
+      result.o3 = o3
+    oprot.writeMessageBegin("add_index", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_drop_index_by_name(self, seqid, iprot, oprot):
+    args = drop_index_by_name_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = drop_index_by_name_result()
+    try:
+      result.success = self._handler.drop_index_by_name(args.db_name, args.tbl_name, args.index_name, args.deleteData)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("drop_index_by_name", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_index_by_name(self, seqid, iprot, oprot):
+    args = get_index_by_name_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_index_by_name_result()
+    try:
+      result.success = self._handler.get_index_by_name(args.db_name, args.tbl_name, args.index_name)
+    except MetaException, o1:
+      result.o1 = o1
+    except NoSuchObjectException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_index_by_name", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_indexes(self, seqid, iprot, oprot):
+    args = get_indexes_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_indexes_result()
+    try:
+      result.success = self._handler.get_indexes(args.db_name, args.tbl_name, args.max_indexes)
+    except NoSuchObjectException, o1:
+      result.o1 = o1
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_indexes", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_get_index_names(self, seqid, iprot, oprot):
+    args = get_index_names_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = get_index_names_result()
+    try:
+      result.success = self._handler.get_index_names(args.db_name, args.tbl_name, args.max_indexes)
+    except MetaException, o2:
+      result.o2 = o2
+    oprot.writeMessageBegin("get_index_names", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
 
 # HELPER FUNCTIONS AND STRUCTURES
 
@@ -2344,10 +2664,10 @@ class get_databases_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype104, _size101) = iprot.readListBegin()
-          for _i105 in xrange(_size101):
-            _elem106 = iprot.readString();
-            self.success.append(_elem106)
+          (_etype106, _size103) = iprot.readListBegin()
+          for _i107 in xrange(_size103):
+            _elem108 = iprot.readString();
+            self.success.append(_elem108)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -2370,8 +2690,8 @@ class get_databases_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRING, len(self.success))
-      for iter107 in self.success:
-        oprot.writeString(iter107)
+      for iter109 in self.success:
+        oprot.writeString(iter109)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -2876,12 +3196,12 @@ class get_type_all_result:
       if fid == 0:
         if ftype == TType.MAP:
           self.success = {}
-          (_ktype109, _vtype110, _size108 ) = iprot.readMapBegin() 
-          for _i112 in xrange(_size108):
-            _key113 = iprot.readString();
-            _val114 = Type()
-            _val114.read(iprot)
-            self.success[_key113] = _val114
+          (_ktype111, _vtype112, _size110 ) = iprot.readMapBegin() 
+          for _i114 in xrange(_size110):
+            _key115 = iprot.readString();
+            _val116 = Type()
+            _val116.read(iprot)
+            self.success[_key115] = _val116
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -2904,9 +3224,9 @@ class get_type_all_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.MAP, 0)
       oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success))
-      for kiter115,viter116 in self.success.items():
-        oprot.writeString(kiter115)
-        viter116.write(oprot)
+      for kiter117,viter118 in self.success.items():
+        oprot.writeString(kiter117)
+        viter118.write(oprot)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     if self.o2 != None:
@@ -3029,11 +3349,11 @@ class get_fields_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype120, _size117) = iprot.readListBegin()
-          for _i121 in xrange(_size117):
-            _elem122 = FieldSchema()
-            _elem122.read(iprot)
-            self.success.append(_elem122)
+          (_etype122, _size119) = iprot.readListBegin()
+          for _i123 in xrange(_size119):
+            _elem124 = FieldSchema()
+            _elem124.read(iprot)
+            self.success.append(_elem124)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -3068,8 +3388,8 @@ class get_fields_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRUCT, len(self.success))
-      for iter123 in self.success:
-        iter123.write(oprot)
+      for iter125 in self.success:
+        iter125.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -3200,11 +3520,11 @@ class get_schema_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype127, _size124) = iprot.readListBegin()
-          for _i128 in xrange(_size124):
-            _elem129 = FieldSchema()
-            _elem129.read(iprot)
-            self.success.append(_elem129)
+          (_etype129, _size126) = iprot.readListBegin()
+          for _i130 in xrange(_size126):
+            _elem131 = FieldSchema()
+            _elem131.read(iprot)
+            self.success.append(_elem131)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -3239,8 +3559,8 @@ class get_schema_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRUCT, len(self.success))
-      for iter130 in self.success:
-        iter130.write(oprot)
+      for iter132 in self.success:
+        iter132.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -3668,10 +3988,10 @@ class get_tables_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype134, _size131) = iprot.readListBegin()
-          for _i135 in xrange(_size131):
-            _elem136 = iprot.readString();
-            self.success.append(_elem136)
+          (_etype136, _size133) = iprot.readListBegin()
+          for _i137 in xrange(_size133):
+            _elem138 = iprot.readString();
+            self.success.append(_elem138)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -3694,8 +4014,8 @@ class get_tables_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRING, len(self.success))
-      for iter137 in self.success:
-        oprot.writeString(iter137)
+      for iter139 in self.success:
+        oprot.writeString(iter139)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -4211,10 +4531,10 @@ class append_partition_args:
       elif fid == 3:
         if ftype == TType.LIST:
           self.part_vals = []
-          (_etype141, _size138) = iprot.readListBegin()
-          for _i142 in xrange(_size138):
-            _elem143 = iprot.readString();
-            self.part_vals.append(_elem143)
+          (_etype143, _size140) = iprot.readListBegin()
+          for _i144 in xrange(_size140):
+            _elem145 = iprot.readString();
+            self.part_vals.append(_elem145)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -4239,8 +4559,8 @@ class append_partition_args:
     if self.part_vals != None:
       oprot.writeFieldBegin('part_vals', TType.LIST, 3)
       oprot.writeListBegin(TType.STRING, len(self.part_vals))
-      for iter144 in self.part_vals:
-        oprot.writeString(iter144)
+      for iter146 in self.part_vals:
+        oprot.writeString(iter146)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -4572,10 +4892,10 @@ class drop_partition_args:
       elif fid == 3:
         if ftype == TType.LIST:
           self.part_vals = []
-          (_etype148, _size145) = iprot.readListBegin()
-          for _i149 in xrange(_size145):
-            _elem150 = iprot.readString();
-            self.part_vals.append(_elem150)
+          (_etype150, _size147) = iprot.readListBegin()
+          for _i151 in xrange(_size147):
+            _elem152 = iprot.readString();
+            self.part_vals.append(_elem152)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -4605,8 +4925,8 @@ class drop_partition_args:
     if self.part_vals != None:
       oprot.writeFieldBegin('part_vals', TType.LIST, 3)
       oprot.writeListBegin(TType.STRING, len(self.part_vals))
-      for iter151 in self.part_vals:
-        oprot.writeString(iter151)
+      for iter153 in self.part_vals:
+        oprot.writeString(iter153)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.deleteData != None:
@@ -4923,10 +5243,10 @@ class get_partition_args:
       elif fid == 3:
         if ftype == TType.LIST:
           self.part_vals = []
-          (_etype155, _size152) = iprot.readListBegin()
-          for _i156 in xrange(_size152):
-            _elem157 = iprot.readString();
-            self.part_vals.append(_elem157)
+          (_etype157, _size154) = iprot.readListBegin()
+          for _i158 in xrange(_size154):
+            _elem159 = iprot.readString();
+            self.part_vals.append(_elem159)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -4951,8 +5271,8 @@ class get_partition_args:
     if self.part_vals != None:
       oprot.writeFieldBegin('part_vals', TType.LIST, 3)
       oprot.writeListBegin(TType.STRING, len(self.part_vals))
-      for iter158 in self.part_vals:
-        oprot.writeString(iter158)
+      for iter160 in self.part_vals:
+        oprot.writeString(iter160)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -5324,11 +5644,11 @@ class get_partitions_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype162, _size159) = iprot.readListBegin()
-          for _i163 in xrange(_size159):
-            _elem164 = Partition()
-            _elem164.read(iprot)
-            self.success.append(_elem164)
+          (_etype164, _size161) = iprot.readListBegin()
+          for _i165 in xrange(_size161):
+            _elem166 = Partition()
+            _elem166.read(iprot)
+            self.success.append(_elem166)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -5357,8 +5677,8 @@ class get_partitions_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRUCT, len(self.success))
-      for iter165 in self.success:
-        iter165.write(oprot)
+      for iter167 in self.success:
+        iter167.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -5491,10 +5811,10 @@ class get_partition_names_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype169, _size166) = iprot.readListBegin()
-          for _i170 in xrange(_size166):
-            _elem171 = iprot.readString();
-            self.success.append(_elem171)
+          (_etype171, _size168) = iprot.readListBegin()
+          for _i172 in xrange(_size168):
+            _elem173 = iprot.readString();
+            self.success.append(_elem173)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -5517,8 +5837,8 @@ class get_partition_names_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRING, len(self.success))
-      for iter172 in self.success:
-        oprot.writeString(iter172)
+      for iter174 in self.success:
+        oprot.writeString(iter174)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o2 != None:
@@ -5584,10 +5904,10 @@ class get_partitions_ps_args:
       elif fid == 3:
         if ftype == TType.LIST:
           self.part_vals = []
-          (_etype176, _size173) = iprot.readListBegin()
-          for _i177 in xrange(_size173):
-            _elem178 = iprot.readString();
-            self.part_vals.append(_elem178)
+          (_etype178, _size175) = iprot.readListBegin()
+          for _i179 in xrange(_size175):
+            _elem180 = iprot.readString();
+            self.part_vals.append(_elem180)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -5617,8 +5937,8 @@ class get_partitions_ps_args:
     if self.part_vals != None:
       oprot.writeFieldBegin('part_vals', TType.LIST, 3)
       oprot.writeListBegin(TType.STRING, len(self.part_vals))
-      for iter179 in self.part_vals:
-        oprot.writeString(iter179)
+      for iter181 in self.part_vals:
+        oprot.writeString(iter181)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.max_parts != None:
@@ -5667,11 +5987,11 @@ class get_partitions_ps_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype183, _size180) = iprot.readListBegin()
-          for _i184 in xrange(_size180):
-            _elem185 = Partition()
-            _elem185.read(iprot)
-            self.success.append(_elem185)
+          (_etype185, _size182) = iprot.readListBegin()
+          for _i186 in xrange(_size182):
+            _elem187 = Partition()
+            _elem187.read(iprot)
+            self.success.append(_elem187)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -5694,8 +6014,8 @@ class get_partitions_ps_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRUCT, len(self.success))
-      for iter186 in self.success:
-        iter186.write(oprot)
+      for iter188 in self.success:
+        iter188.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -5761,10 +6081,10 @@ class get_partition_names_ps_args:
       elif fid == 3:
         if ftype == TType.LIST:
           self.part_vals = []
-          (_etype190, _size187) = iprot.readListBegin()
-          for _i191 in xrange(_size187):
-            _elem192 = iprot.readString();
-            self.part_vals.append(_elem192)
+          (_etype192, _size189) = iprot.readListBegin()
+          for _i193 in xrange(_size189):
+            _elem194 = iprot.readString();
+            self.part_vals.append(_elem194)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -5794,8 +6114,8 @@ class get_partition_names_ps_args:
     if self.part_vals != None:
       oprot.writeFieldBegin('part_vals', TType.LIST, 3)
       oprot.writeListBegin(TType.STRING, len(self.part_vals))
-      for iter193 in self.part_vals:
-        oprot.writeString(iter193)
+      for iter195 in self.part_vals:
+        oprot.writeString(iter195)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.max_parts != None:
@@ -5844,10 +6164,10 @@ class get_partition_names_ps_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype197, _size194) = iprot.readListBegin()
-          for _i198 in xrange(_size194):
-            _elem199 = iprot.readString();
-            self.success.append(_elem199)
+          (_etype199, _size196) = iprot.readListBegin()
+          for _i200 in xrange(_size196):
+            _elem201 = iprot.readString();
+            self.success.append(_elem201)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -5870,8 +6190,8 @@ class get_partition_names_ps_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRING, len(self.success))
-      for iter200 in self.success:
-        oprot.writeString(iter200)
+      for iter202 in self.success:
+        oprot.writeString(iter202)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -6263,10 +6583,10 @@ class partition_name_to_vals_result:
       if fid == 0:
         if ftype == TType.LIST:
           self.success = []
-          (_etype204, _size201) = iprot.readListBegin()
-          for _i205 in xrange(_size201):
-            _elem206 = iprot.readString();
-            self.success.append(_elem206)
+          (_etype206, _size203) = iprot.readListBegin()
+          for _i207 in xrange(_size203):
+            _elem208 = iprot.readString();
+            self.success.append(_elem208)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -6289,8 +6609,8 @@ class partition_name_to_vals_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.LIST, 0)
       oprot.writeListBegin(TType.STRING, len(self.success))
-      for iter207 in self.success:
-        oprot.writeString(iter207)
+      for iter209 in self.success:
+        oprot.writeString(iter209)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -6395,11 +6715,11 @@ class partition_name_to_spec_result:
       if fid == 0:
         if ftype == TType.MAP:
           self.success = {}
-          (_ktype209, _vtype210, _size208 ) = iprot.readMapBegin() 
-          for _i212 in xrange(_size208):
-            _key213 = iprot.readString();
-            _val214 = iprot.readString();
-            self.success[_key213] = _val214
+          (_ktype211, _vtype212, _size210 ) = iprot.readMapBegin() 
+          for _i214 in xrange(_size210):
+            _key215 = iprot.readString();
+            _val216 = iprot.readString();
+            self.success[_key215] = _val216
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -6422,9 +6742,9 @@ class partition_name_to_spec_result:
     if self.success != None:
       oprot.writeFieldBegin('success', TType.MAP, 0)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success))
-      for kiter215,viter216 in self.success.items():
-        oprot.writeString(kiter215)
-        oprot.writeString(viter216)
+      for kiter217,viter218 in self.success.items():
+        oprot.writeString(kiter217)
+        oprot.writeString(viter218)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     if self.o1 != None:
@@ -6445,4 +6765,830 @@ class partition_name_to_spec_result:
   def __ne__(self, other):
     return not (self == other)
 
+class add_index_args:
+  """
+  Attributes:
+   - new_index
+   - index_table
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'new_index', (Index, Index.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'index_table', (Table, Table.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, new_index=None, index_table=None,):
+    self.new_index = new_index
+    self.index_table = index_table
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.new_index = Index()
+          self.new_index.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.index_table = Table()
+          self.index_table.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('add_index_args')
+    if self.new_index != None:
+      oprot.writeFieldBegin('new_index', TType.STRUCT, 1)
+      self.new_index.write(oprot)
+      oprot.writeFieldEnd()
+    if self.index_table != None:
+      oprot.writeFieldBegin('index_table', TType.STRUCT, 2)
+      self.index_table.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class add_index_result:
+  """
+  Attributes:
+   - success
+   - o1
+   - o2
+   - o3
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Index, Index.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o1', (InvalidObjectException, InvalidObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 2
+    (3, TType.STRUCT, 'o3', (MetaException, MetaException.thrift_spec), None, ), # 3
+  )
+
+  def __init__(self, success=None, o1=None, o2=None, o3=None,):
+    self.success = success
+    self.o1 = o1
+    self.o2 = o2
+    self.o3 = o3
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Index()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = InvalidObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = AlreadyExistsException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRUCT:
+          self.o3 = MetaException()
+          self.o3.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('add_index_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o3 != None:
+      oprot.writeFieldBegin('o3', TType.STRUCT, 3)
+      self.o3.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_index_by_name_args:
+  """
+  Attributes:
+   - db_name
+   - tbl_name
+   - index_name
+   - deleteData
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.STRING, 'index_name', None, None, ), # 3
+    (4, TType.BOOL, 'deleteData', None, None, ), # 4
+  )
+
+  def __init__(self, db_name=None, tbl_name=None, index_name=None, deleteData=None,):
+    self.db_name = db_name
+    self.tbl_name = tbl_name
+    self.index_name = index_name
+    self.deleteData = deleteData
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.index_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.BOOL:
+          self.deleteData = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_index_by_name_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.index_name != None:
+      oprot.writeFieldBegin('index_name', TType.STRING, 3)
+      oprot.writeString(self.index_name)
+      oprot.writeFieldEnd()
+    if self.deleteData != None:
+      oprot.writeFieldBegin('deleteData', TType.BOOL, 4)
+      oprot.writeBool(self.deleteData)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class drop_index_by_name_result:
+  """
+  Attributes:
+   - success
+   - o1
+   - o2
+  """
+
+  thrift_spec = (
+    (0, TType.BOOL, 'success', None, None, ), # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, success=None, o1=None, o2=None,):
+    self.success = success
+    self.o1 = o1
+    self.o2 = o2
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.BOOL:
+          self.success = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('drop_index_by_name_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.BOOL, 0)
+      oprot.writeBool(self.success)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_index_by_name_args:
+  """
+  Attributes:
+   - db_name
+   - tbl_name
+   - index_name
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.STRING, 'index_name', None, None, ), # 3
+  )
+
+  def __init__(self, db_name=None, tbl_name=None, index_name=None,):
+    self.db_name = db_name
+    self.tbl_name = tbl_name
+    self.index_name = index_name
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.index_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_index_by_name_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.index_name != None:
+      oprot.writeFieldBegin('index_name', TType.STRING, 3)
+      oprot.writeString(self.index_name)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_index_by_name_result:
+  """
+  Attributes:
+   - success
+   - o1
+   - o2
+  """
+
+  thrift_spec = (
+    (0, TType.STRUCT, 'success', (Index, Index.thrift_spec), None, ), # 0
+    (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, success=None, o1=None, o2=None,):
+    self.success = success
+    self.o1 = o1
+    self.o2 = o2
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.STRUCT:
+          self.success = Index()
+          self.success.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = MetaException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = NoSuchObjectException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_index_by_name_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.STRUCT, 0)
+      self.success.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_indexes_args:
+  """
+  Attributes:
+   - db_name
+   - tbl_name
+   - max_indexes
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.I16, 'max_indexes', None, -1, ), # 3
+  )
+
+  def __init__(self, db_name=None, tbl_name=None, max_indexes=thrift_spec[3][4],):
+    self.db_name = db_name
+    self.tbl_name = tbl_name
+    self.max_indexes = max_indexes
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.I16:
+          self.max_indexes = iprot.readI16();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_indexes_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.max_indexes != None:
+      oprot.writeFieldBegin('max_indexes', TType.I16, 3)
+      oprot.writeI16(self.max_indexes)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_indexes_result:
+  """
+  Attributes:
+   - success
+   - o1
+   - o2
+  """
+
+  thrift_spec = (
+    (0, TType.LIST, 'success', (TType.STRUCT,(Index, Index.thrift_spec)), None, ), # 0
+    (1, TType.STRUCT, 'o1', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 1
+    (2, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 2
+  )
+
+  def __init__(self, success=None, o1=None, o2=None,):
+    self.success = success
+    self.o1 = o1
+    self.o2 = o2
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.LIST:
+          self.success = []
+          (_etype222, _size219) = iprot.readListBegin()
+          for _i223 in xrange(_size219):
+            _elem224 = Index()
+            _elem224.read(iprot)
+            self.success.append(_elem224)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o1 = NoSuchObjectException()
+          self.o1.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_indexes_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.LIST, 0)
+      oprot.writeListBegin(TType.STRUCT, len(self.success))
+      for iter225 in self.success:
+        iter225.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.o1 != None:
+      oprot.writeFieldBegin('o1', TType.STRUCT, 1)
+      self.o1.write(oprot)
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 2)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_index_names_args:
+  """
+  Attributes:
+   - db_name
+   - tbl_name
+   - max_indexes
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'db_name', None, None, ), # 1
+    (2, TType.STRING, 'tbl_name', None, None, ), # 2
+    (3, TType.I16, 'max_indexes', None, -1, ), # 3
+  )
+
+  def __init__(self, db_name=None, tbl_name=None, max_indexes=thrift_spec[3][4],):
+    self.db_name = db_name
+    self.tbl_name = tbl_name
+    self.max_indexes = max_indexes
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.db_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.tbl_name = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.I16:
+          self.max_indexes = iprot.readI16();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_index_names_args')
+    if self.db_name != None:
+      oprot.writeFieldBegin('db_name', TType.STRING, 1)
+      oprot.writeString(self.db_name)
+      oprot.writeFieldEnd()
+    if self.tbl_name != None:
+      oprot.writeFieldBegin('tbl_name', TType.STRING, 2)
+      oprot.writeString(self.tbl_name)
+      oprot.writeFieldEnd()
+    if self.max_indexes != None:
+      oprot.writeFieldBegin('max_indexes', TType.I16, 3)
+      oprot.writeI16(self.max_indexes)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class get_index_names_result:
+  """
+  Attributes:
+   - success
+   - o2
+  """
+
+  thrift_spec = (
+    (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0
+    (1, TType.STRUCT, 'o2', (MetaException, MetaException.thrift_spec), None, ), # 1
+  )
+
+  def __init__(self, success=None, o2=None,):
+    self.success = success
+    self.o2 = o2
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 0:
+        if ftype == TType.LIST:
+          self.success = []
+          (_etype229, _size226) = iprot.readListBegin()
+          for _i230 in xrange(_size226):
+            _elem231 = iprot.readString();
+            self.success.append(_elem231)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 1:
+        if ftype == TType.STRUCT:
+          self.o2 = MetaException()
+          self.o2.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('get_index_names_result')
+    if self.success != None:
+      oprot.writeFieldBegin('success', TType.LIST, 0)
+      oprot.writeListBegin(TType.STRING, len(self.success))
+      for iter232 in self.success:
+        oprot.writeString(iter232)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.o2 != None:
+      oprot.writeFieldBegin('o2', TType.STRUCT, 1)
+      self.o2.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
 

Modified: hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py?rev=980659&r1=980658&r2=980659&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py (original)
+++ hadoop/hive/trunk/metastore/src/gen-py/hive_metastore/ttypes.py Fri Jul 30 06:40:04 2010
@@ -1051,30 +1051,42 @@ class Index:
   """
   Attributes:
    - indexName
-   - indexType
-   - tableName
+   - indexHandlerClass
    - dbName
-   - colNames
-   - partName
+   - origTableName
+   - createTime
+   - lastAccessTime
+   - indexTableName
+   - sd
+   - parameters
+   - deferredRebuild
   """
 
   thrift_spec = (
     None, # 0
     (1, TType.STRING, 'indexName', None, None, ), # 1
-    (2, TType.I32, 'indexType', None, None, ), # 2
-    (3, TType.STRING, 'tableName', None, None, ), # 3
-    (4, TType.STRING, 'dbName', None, None, ), # 4
-    (5, TType.LIST, 'colNames', (TType.STRING,None), None, ), # 5
-    (6, TType.STRING, 'partName', None, None, ), # 6
+    (2, TType.STRING, 'indexHandlerClass', None, None, ), # 2
+    (3, TType.STRING, 'dbName', None, None, ), # 3
+    (4, TType.STRING, 'origTableName', None, None, ), # 4
+    (5, TType.I32, 'createTime', None, None, ), # 5
+    (6, TType.I32, 'lastAccessTime', None, None, ), # 6
+    (7, TType.STRING, 'indexTableName', None, None, ), # 7
+    (8, TType.STRUCT, 'sd', (StorageDescriptor, StorageDescriptor.thrift_spec), None, ), # 8
+    (9, TType.MAP, 'parameters', (TType.STRING,None,TType.STRING,None), None, ), # 9
+    (10, TType.BOOL, 'deferredRebuild', None, None, ), # 10
   )
 
-  def __init__(self, indexName=None, indexType=None, tableName=None, dbName=None, colNames=None, partName=None,):
+  def __init__(self, indexName=None, indexHandlerClass=None, dbName=None, origTableName=None, createTime=None, lastAccessTime=None, indexTableName=None, sd=None, parameters=None, deferredRebuild=None,):
     self.indexName = indexName
-    self.indexType = indexType
-    self.tableName = tableName
+    self.indexHandlerClass = indexHandlerClass
     self.dbName = dbName
-    self.colNames = colNames
-    self.partName = partName
+    self.origTableName = origTableName
+    self.createTime = createTime
+    self.lastAccessTime = lastAccessTime
+    self.indexTableName = indexTableName
+    self.sd = sd
+    self.parameters = parameters
+    self.deferredRebuild = deferredRebuild
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1091,33 +1103,55 @@ class Index:
         else:
           iprot.skip(ftype)
       elif fid == 2:
-        if ftype == TType.I32:
-          self.indexType = iprot.readI32();
+        if ftype == TType.STRING:
+          self.indexHandlerClass = iprot.readString();
         else:
           iprot.skip(ftype)
       elif fid == 3:
         if ftype == TType.STRING:
-          self.tableName = iprot.readString();
+          self.dbName = iprot.readString();
         else:
           iprot.skip(ftype)
       elif fid == 4:
         if ftype == TType.STRING:
-          self.dbName = iprot.readString();
+          self.origTableName = iprot.readString();
         else:
           iprot.skip(ftype)
       elif fid == 5:
-        if ftype == TType.LIST:
-          self.colNames = []
-          (_etype81, _size78) = iprot.readListBegin()
-          for _i82 in xrange(_size78):
-            _elem83 = iprot.readString();
-            self.colNames.append(_elem83)
-          iprot.readListEnd()
+        if ftype == TType.I32:
+          self.createTime = iprot.readI32();
         else:
           iprot.skip(ftype)
       elif fid == 6:
+        if ftype == TType.I32:
+          self.lastAccessTime = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 7:
         if ftype == TType.STRING:
-          self.partName = iprot.readString();
+          self.indexTableName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 8:
+        if ftype == TType.STRUCT:
+          self.sd = StorageDescriptor()
+          self.sd.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 9:
+        if ftype == TType.MAP:
+          self.parameters = {}
+          (_ktype79, _vtype80, _size78 ) = iprot.readMapBegin() 
+          for _i82 in xrange(_size78):
+            _key83 = iprot.readString();
+            _val84 = iprot.readString();
+            self.parameters[_key83] = _val84
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 10:
+        if ftype == TType.BOOL:
+          self.deferredRebuild = iprot.readBool();
         else:
           iprot.skip(ftype)
       else:
@@ -1134,28 +1168,45 @@ class Index:
       oprot.writeFieldBegin('indexName', TType.STRING, 1)
       oprot.writeString(self.indexName)
       oprot.writeFieldEnd()
-    if self.indexType != None:
-      oprot.writeFieldBegin('indexType', TType.I32, 2)
-      oprot.writeI32(self.indexType)
-      oprot.writeFieldEnd()
-    if self.tableName != None:
-      oprot.writeFieldBegin('tableName', TType.STRING, 3)
-      oprot.writeString(self.tableName)
+    if self.indexHandlerClass != None:
+      oprot.writeFieldBegin('indexHandlerClass', TType.STRING, 2)
+      oprot.writeString(self.indexHandlerClass)
       oprot.writeFieldEnd()
     if self.dbName != None:
-      oprot.writeFieldBegin('dbName', TType.STRING, 4)
+      oprot.writeFieldBegin('dbName', TType.STRING, 3)
       oprot.writeString(self.dbName)
       oprot.writeFieldEnd()
-    if self.colNames != None:
-      oprot.writeFieldBegin('colNames', TType.LIST, 5)
-      oprot.writeListBegin(TType.STRING, len(self.colNames))
-      for iter84 in self.colNames:
-        oprot.writeString(iter84)
-      oprot.writeListEnd()
+    if self.origTableName != None:
+      oprot.writeFieldBegin('origTableName', TType.STRING, 4)
+      oprot.writeString(self.origTableName)
+      oprot.writeFieldEnd()
+    if self.createTime != None:
+      oprot.writeFieldBegin('createTime', TType.I32, 5)
+      oprot.writeI32(self.createTime)
+      oprot.writeFieldEnd()
+    if self.lastAccessTime != None:
+      oprot.writeFieldBegin('lastAccessTime', TType.I32, 6)
+      oprot.writeI32(self.lastAccessTime)
+      oprot.writeFieldEnd()
+    if self.indexTableName != None:
+      oprot.writeFieldBegin('indexTableName', TType.STRING, 7)
+      oprot.writeString(self.indexTableName)
+      oprot.writeFieldEnd()
+    if self.sd != None:
+      oprot.writeFieldBegin('sd', TType.STRUCT, 8)
+      self.sd.write(oprot)
+      oprot.writeFieldEnd()
+    if self.parameters != None:
+      oprot.writeFieldBegin('parameters', TType.MAP, 9)
+      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
+      for kiter85,viter86 in self.parameters.items():
+        oprot.writeString(kiter85)
+        oprot.writeString(viter86)
+      oprot.writeMapEnd()
       oprot.writeFieldEnd()
-    if self.partName != None:
-      oprot.writeFieldBegin('partName', TType.STRING, 6)
-      oprot.writeString(self.partName)
+    if self.deferredRebuild != None:
+      oprot.writeFieldBegin('deferredRebuild', TType.BOOL, 10)
+      oprot.writeBool(self.deferredRebuild)
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
@@ -1200,22 +1251,22 @@ class Schema:
       if fid == 1:
         if ftype == TType.LIST:
           self.fieldSchemas = []
-          (_etype88, _size85) = iprot.readListBegin()
-          for _i89 in xrange(_size85):
-            _elem90 = FieldSchema()
-            _elem90.read(iprot)
-            self.fieldSchemas.append(_elem90)
+          (_etype90, _size87) = iprot.readListBegin()
+          for _i91 in xrange(_size87):
+            _elem92 = FieldSchema()
+            _elem92.read(iprot)
+            self.fieldSchemas.append(_elem92)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 2:
         if ftype == TType.MAP:
           self.properties = {}
-          (_ktype92, _vtype93, _size91 ) = iprot.readMapBegin() 
-          for _i95 in xrange(_size91):
-            _key96 = iprot.readString();
-            _val97 = iprot.readString();
-            self.properties[_key96] = _val97
+          (_ktype94, _vtype95, _size93 ) = iprot.readMapBegin() 
+          for _i97 in xrange(_size93):
+            _key98 = iprot.readString();
+            _val99 = iprot.readString();
+            self.properties[_key98] = _val99
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -1232,16 +1283,16 @@ class Schema:
     if self.fieldSchemas != None:
       oprot.writeFieldBegin('fieldSchemas', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.fieldSchemas))
-      for iter98 in self.fieldSchemas:
-        iter98.write(oprot)
+      for iter100 in self.fieldSchemas:
+        iter100.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.properties != None:
       oprot.writeFieldBegin('properties', TType.MAP, 2)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.properties))
-      for kiter99,viter100 in self.properties.items():
-        oprot.writeString(kiter99)
-        oprot.writeString(viter100)
+      for kiter101,viter102 in self.properties.items():
+        oprot.writeString(kiter101)
+        oprot.writeString(viter102)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=980659&r1=980658&r2=980659&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Fri Jul 30 06:40:04 2010
@@ -650,6 +650,13 @@ public class HiveMetaStore extends Thrif
       boolean success = false, madeDir = false;
       try {
         ms.openTransaction();
+        
+        // get_table checks whether database exists, it should be moved here
+        if (is_table_exists(tbl.getDbName(), tbl.getTableName())) {
+          throw new AlreadyExistsException("Table " + tbl.getTableName()
+              + " already exists");
+        }
+        
         if (!TableType.VIRTUAL_VIEW.toString().equals(tbl.getTableType())) {
           if (tbl.getSd().getLocation() == null
             || tbl.getSd().getLocation().isEmpty()) {
@@ -665,12 +672,6 @@ public class HiveMetaStore extends Thrif
           tbl.getSd().setLocation(tblPath.toString());
         }
 
-        // get_table checks whether database exists, it should be moved here
-        if (is_table_exists(tbl.getDbName(), tbl.getTableName())) {
-          throw new AlreadyExistsException("Table " + tbl.getTableName()
-              + " already exists");
-        }
-
         if (tblPath != null) {
           if (!wh.isDir(tblPath)) {
             if (!wh.mkdirs(tblPath)) {
@@ -742,6 +743,7 @@ public class HiveMetaStore extends Thrif
       Path tblPath = null;
       Table tbl = null;
       isExternal = false;
+      boolean isIndexTable = false;
       try {
         ms.openTransaction();
         // drop any partitions
@@ -752,10 +754,31 @@ public class HiveMetaStore extends Thrif
         if (tbl.getSd() == null) {
           throw new MetaException("Table metadata is corrupted");
         }
+        
+        isIndexTable = isIndexTable(tbl);
+        if (isIndexTable) {
+          throw new RuntimeException(
+              "The table " + name + " is an index table. Please do drop index instead.");
+        }
+
+        if (!isIndexTable) {
+          try {
+            List<Index> indexes = ms.getIndexes(dbname, name, Short.MAX_VALUE);
+            while(indexes != null && indexes.size()>0) {
+              for (Index idx : indexes) {
+                this.drop_index_by_name(dbname, name, idx.getIndexName(), true);
+              }
+              indexes = ms.getIndexes(dbname, name, Short.MAX_VALUE);
+            }
+          } catch (TException e) {
+            throw new MetaException(e.getMessage());
+          }
+        }
         isExternal = isExternal(tbl);
         if (tbl.getSd().getLocation() != null) {
           tblPath = new Path(tbl.getSd().getLocation());
         }
+        
         if (!ms.dropTable(dbname, name)) {
           throw new MetaException("Unable to drop table");
         }
@@ -805,6 +828,10 @@ public class HiveMetaStore extends Thrif
     private boolean isExternal(Table table) {
       return MetaStoreUtils.isExternalTable(table);
     }
+    
+    private boolean isIndexTable (Table table) {
+      return MetaStoreUtils.isIndexTable(table);
+    }
 
     public Table get_table(final String dbname, final String name) throws MetaException,
         NoSuchObjectException {
@@ -1671,6 +1698,257 @@ public class HiveMetaStore extends Thrif
       return Warehouse.makeSpecFromName(part_name);
     }
 
+    @Override
+    public Index add_index(final Index newIndex, final Table indexTable) throws InvalidObjectException,
+        AlreadyExistsException, MetaException, TException {
+      incrementCounter("add_partition");
+      logStartFunction("add_index: db=" + newIndex.getDbName() + " tbl="
+          + newIndex.getOrigTableName() + " index=" + newIndex.getIndexName());
+      Index ret = null;
+      try {
+        ret = executeWithRetry(new Command<Index>() {
+          @Override
+          Index run(RawStore ms) throws Exception {
+            return add_index_core(ms, newIndex, indexTable);
+          }
+        });
+      } catch (InvalidObjectException e) {
+        throw e;
+      } catch (AlreadyExistsException e) {
+        throw e;
+      } catch (MetaException e) {
+        throw e;
+      } catch (Exception e) {
+        assert(e instanceof RuntimeException);
+        throw (RuntimeException)e;
+      }
+      return ret;
+    }
+    
+    private Index add_index_core(final RawStore ms, final Index index, final Table indexTable)
+        throws InvalidObjectException, AlreadyExistsException, MetaException {
+      
+      boolean success = false, indexTableCreated = false;
+      
+      try {
+        ms.openTransaction();
+        Index old_index = null;
+        try {
+          old_index = get_index_by_name(index.getDbName(), index
+              .getOrigTableName(), index.getIndexName());
+        } catch (Exception e) {
+        }
+        if (old_index != null) {
+          throw new AlreadyExistsException("Index already exists:" + index);
+        }
+        Table origTbl = ms.getTable(index.getDbName(), index.getOrigTableName());
+        if (origTbl == null) {
+          throw new InvalidObjectException(
+              "Unable to add index because database or the orginal table do not exist");
+        }
+        
+        // set create time
+        long time = System.currentTimeMillis() / 1000;
+        Table indexTbl = indexTable;
+        if (indexTbl != null) {
+          try {
+            indexTbl = ms.getTable(index.getDbName(), index.getIndexTableName());  
+          } catch (Exception e) {
+          }
+          if (indexTbl != null) {
+            throw new InvalidObjectException(
+                "Unable to add index because index table already exists");
+          }
+          this.create_table(indexTable);
+          indexTableCreated = true;
+        }
+
+        index.setCreateTime((int) time);
+        index.putToParameters(Constants.DDL_TIME, Long.toString(time));
+
+        ms.addIndex(index);
+        success = ms.commitTransaction();
+        return index;
+      } finally {
+        if (!success) {
+          if (indexTableCreated) {
+            try {
+              this.drop_table(index.getDbName(), index.getIndexTableName(), false);
+            } catch (Exception e) {
+            }
+          }
+          ms.rollbackTransaction();
+        }
+      }
+    }
+
+    @Override
+    public boolean drop_index_by_name(final String dbName, final String tblName,
+        final String indexName, final boolean deleteData) throws NoSuchObjectException,
+        MetaException, TException {
+      incrementCounter("drop_index_by_name");
+      logStartFunction("drop_index_by_name: db=" + dbName + " tbl="
+          + tblName + " index=" + indexName);
+
+      Boolean ret = null;
+      try {
+        ret = executeWithRetry(new Command<Boolean>() {
+          @Override
+          Boolean run(RawStore ms) throws Exception {
+            return drop_index_by_name_core(ms, dbName, tblName,
+                indexName, deleteData);
+          }
+        });
+      } catch (NoSuchObjectException e) {
+        throw e;
+      } catch (MetaException e) {
+        throw e;
+      } catch (TException e) {
+        throw e;
+      } catch (Exception e) {
+        assert(e instanceof RuntimeException);
+        throw (RuntimeException)e;
+      }
+
+      return ret.booleanValue();
+    }
+    
+    private boolean drop_index_by_name_core(final RawStore ms,
+        final String dbName, final String tblName,
+        final String indexName, final boolean deleteData) throws NoSuchObjectException,
+        MetaException, TException {
+
+      boolean success = false;
+      Path tblPath = null;
+      try {
+        ms.openTransaction();
+        
+        //drop the underlying index table
+        Index index = get_index_by_name(dbName, tblName, indexName);
+        if (index == null) {
+          throw new NoSuchObjectException(indexName + " doesn't exist");
+        }
+        ms.dropIndex(dbName, tblName, indexName);
+        
+        String idxTblName = index.getIndexTableName();
+        if (idxTblName != null) {
+          Table tbl = null;
+          tbl = this.get_table(dbName, idxTblName);
+          if (tbl.getSd() == null) {
+            throw new MetaException("Table metadata is corrupted");
+          }
+          
+          if (tbl.getSd().getLocation() != null) {
+            tblPath = new Path(tbl.getSd().getLocation());
+          }
+          if (!ms.dropTable(dbName, idxTblName)) {
+            throw new MetaException("Unable to drop underlying data table "
+                + idxTblName + " for index " + idxTblName);
+          }
+        }
+        success = ms.commitTransaction();
+      } finally {
+        if (!success) {
+          ms.rollbackTransaction();
+          return false;
+        } else if (deleteData && tblPath != null) {
+          wh.deleteDir(tblPath, true);
+          // ok even if the data is not deleted
+        }
+      }
+      return true;
+    }
+
+    @Override
+    public Index get_index_by_name(final String dbName, final String tblName,
+        final String indexName) throws MetaException, NoSuchObjectException,
+        TException {
+
+      incrementCounter("get_index_by_name");
+      logStartFunction("get_index_by_name: db=" + dbName + " tbl="
+          + tblName + " index=" + indexName);
+
+      Index ret = null;
+
+      try {
+        ret = executeWithRetry(new Command<Index>() {
+          @Override
+          Index run(RawStore ms) throws Exception {
+            return get_index_by_name_core(ms, dbName, tblName, indexName);
+          }
+        });
+      } catch (MetaException e) {
+        throw e;
+      } catch (NoSuchObjectException e) {
+        throw e;
+      } catch (TException e) {
+        throw e;
+      } catch (Exception e) {
+        assert(e instanceof RuntimeException);
+        throw (RuntimeException)e;
+      }
+      return ret;
+    }
+    
+    private Index get_index_by_name_core(final RawStore ms, final String db_name,
+        final String tbl_name, final String index_name)
+        throws MetaException, NoSuchObjectException, TException {
+      Index index = ms.getIndex(db_name, tbl_name, index_name);
+
+      if (index == null) {
+        throw new NoSuchObjectException(db_name + "." + tbl_name
+            + " index=" + index_name + " not found");
+      }
+      return index;
+    }
+
+    @Override
+    public List<String> get_index_names(final String dbName, final String tblName,
+        final short maxIndexes) throws MetaException, TException {
+      incrementCounter("get_index_names");
+      logStartFunction("get_index_names", dbName, tblName);
+
+      List<String> ret = null;
+      try {
+        ret = executeWithRetry(new Command<List<String>>() {
+          @Override
+          List<String> run(RawStore ms) throws Exception {
+            return ms.listIndexNames(dbName, tblName, maxIndexes);
+          }
+        });
+      } catch (MetaException e) {
+        throw e;
+      } catch (Exception e) {
+        assert(e instanceof RuntimeException);
+        throw (RuntimeException)e;
+      }
+      return ret;
+    }
+
+    @Override
+    public List<Index> get_indexes(final String dbName, final String tblName,
+        final short maxIndexes) throws NoSuchObjectException, MetaException,
+        TException {
+      incrementCounter("get_indexs");
+      logStartFunction("get_indexs", dbName, tblName);
+
+      List<Index> ret = null;
+      try {
+        ret = executeWithRetry(new Command<List<Index>>() {
+          @Override
+          List<Index> run(RawStore ms) throws Exception {
+            return ms.getIndexes(dbName, tblName, maxIndexes);
+          }
+        });
+      } catch (MetaException e) {
+        throw e;
+      } catch (Exception e) {
+        assert(e instanceof RuntimeException);
+        throw (RuntimeException)e;
+      }
+      return ret;
+    }
+
   }
 
   /**

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java?rev=980659&r1=980658&r2=980659&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java Fri Jul 30 06:40:04 2010
@@ -32,6 +32,7 @@ import org.apache.hadoop.hive.metastore.
 import org.apache.hadoop.hive.metastore.api.ConfigValSecurityException;
 import org.apache.hadoop.hive.metastore.api.Database;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.api.Index;
 import org.apache.hadoop.hive.metastore.api.InvalidObjectException;
 import org.apache.hadoop.hive.metastore.api.InvalidOperationException;
 import org.apache.hadoop.hive.metastore.api.MetaException;
@@ -603,8 +604,68 @@ public class HiveMetaStoreClient impleme
       UnknownDBException {
     return deepCopyFieldSchemas(client.get_fields(db, tableName));
   }
+  
+  /**
+   * create an index
+   * @param index the index object
+   * @param index table which stores the index data
+   * @throws InvalidObjectException
+   * @throws MetaException
+   * @throws NoSuchObjectException
+   * @throws TException
+   * @throws AlreadyExistsException 
+   */
+  public void createIndex(Index index, Table indexTable) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException {
+    client.add_index(index, indexTable);
+  }
+  
+  /**
+   * @param dbName
+   * @param tblName
+   * @param indexName
+   * @return
+   * @throws MetaException
+   * @throws UnknownTableException
+   * @throws NoSuchObjectException
+   * @throws TException
+   */
+  public Index getIndex(String dbName, String tblName, String indexName)
+      throws MetaException, UnknownTableException, NoSuchObjectException,
+      TException {
+    return client.get_index_by_name(dbName, tblName, indexName);
+  }
+
+  /**
+   * list indexes of the give base table
+   * @param db_name
+   * @param tbl_name
+   * @param max
+   * @return
+   * @throws NoSuchObjectException
+   * @throws MetaException
+   * @throws TException
+   */
+  public List<String> listIndexNames(String dbName, String tblName, short max)
+      throws MetaException, TException {
+    return client.get_index_names(dbName, tblName, max);
+  }
 
   /**
+   * list all the index names of the give base table.
+   * 
+   * @param db_name
+   * @param tbl_name
+   * @param max
+   * @return
+   * @throws MetaException
+   * @throws TException
+   */
+  public List<Index> listIndexes(String dbName, String tblName, short max)
+      throws NoSuchObjectException, MetaException, TException {
+    return client.get_indexes(dbName, tblName, max);
+  }
+  
+  /**
    * @param db
    * @param tableName
    * @throws UnknownTableException
@@ -654,7 +715,7 @@ public class HiveMetaStoreClient impleme
   }
 
   @Override
-  public Map<String, String> partitionNameToSpec(String name) throws MetaException, TException {
+  public Map<String, String> partitionNameToSpec(String name) throws MetaException, TException{
     return client.partition_name_to_spec(name);
   }
 
@@ -734,4 +795,12 @@ public class HiveMetaStoreClient impleme
     }
     return copy;
   }
+
+  @Override
+  public boolean dropIndex(String dbName, String tblName, String name,
+      boolean deleteData) throws NoSuchObjectException, MetaException,
+      TException {
+    return client.drop_index_by_name(dbName, tblName, name, deleteData);
+  }
+
 }

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java?rev=980659&r1=980658&r2=980659&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java Fri Jul 30 06:40:04 2010
@@ -24,6 +24,8 @@ import java.util.Map;
 import org.apache.hadoop.hive.metastore.api.AlreadyExistsException;
 import org.apache.hadoop.hive.metastore.api.ConfigValSecurityException;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.metastore.api.Index;
+import org.apache.hadoop.hive.metastore.api.IndexAlreadyExistsException;
 import org.apache.hadoop.hive.metastore.api.InvalidObjectException;
 import org.apache.hadoop.hive.metastore.api.InvalidOperationException;
 import org.apache.hadoop.hive.metastore.api.MetaException;
@@ -329,4 +331,72 @@ public interface IMetaStoreClient {
    */
   public Map<String, String> partitionNameToSpec(String name)
       throws MetaException, TException;
+
+  /**
+   * create an index
+   * @param index the index object
+   * @throws InvalidObjectException
+   * @throws MetaException
+   * @throws NoSuchObjectException
+   * @throws TException
+   * @throws AlreadyExistsException 
+   */
+  public void createIndex(Index index, Table indexTable) throws InvalidObjectException,
+      MetaException, NoSuchObjectException, TException, AlreadyExistsException;
+
+  /**
+   * 
+   * @param dbName
+   * @param tblName
+   * @param indexName
+   * @return
+   * @throws MetaException
+   * @throws UnknownTableException
+   * @throws NoSuchObjectException
+   * @throws TException
+   */
+  public Index getIndex(String dbName, String tblName, String indexName)
+      throws MetaException, UnknownTableException, NoSuchObjectException,
+      TException;
+
+
+  /**
+   * list indexes of the give base table
+   * @param db_name
+   * @param tbl_name
+   * @param max
+   * @return
+   * @throws NoSuchObjectException
+   * @throws MetaException
+   * @throws TException
+   */
+  public List<Index> listIndexes(String db_name, String tbl_name,
+      short max) throws NoSuchObjectException, MetaException, TException;
+
+  /**
+   * list all the index names of the give base table.
+   * 
+   * @param db_name
+   * @param tbl_name
+   * @param max
+   * @return
+   * @throws MetaException
+   * @throws TException
+   */
+  public List<String> listIndexNames(String db_name, String tbl_name,
+      short max) throws MetaException, TException;
+  
+  /**
+   * @param db_name
+   * @param tbl_name
+   * @param name index name
+   * @param deleteData
+   * @return
+   * @throws NoSuchObjectException
+   * @throws MetaException
+   * @throws TException
+   */
+  public boolean dropIndex(String db_name, String tbl_name,
+      String name, boolean deleteData) throws NoSuchObjectException,
+      MetaException, TException;
 }

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java?rev=980659&r1=980658&r2=980659&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java Fri Jul 30 06:40:04 2010
@@ -60,7 +60,7 @@ public class MetaStoreUtils {
   protected static final Log LOG = LogFactory.getLog("hive.log");
 
   public static final String DEFAULT_DATABASE_NAME = "default";
-
+  
   /**
    * printStackTrace
    *
@@ -883,4 +883,16 @@ public class MetaStoreUtils {
     }
     return true;
   }
+  
+  public static String getIndexTableName(String dbName, String baseTblName, String indexName) {
+    return dbName + "__" + baseTblName + "_" + indexName + "__";
+  }
+
+  public static boolean isIndexTable(Table table) {
+    if (table == null) {
+      return false;
+    }
+    return TableType.INDEX_TABLE.toString().equals(table.getTableType());
+  }
+  
 }



Mime
View raw message