소스 검색

HUE-600. Update Beeswax's hive_metastore.thrift interface spec

Harsh J 14 년 전
부모
커밋
6b9c4557ea

+ 249 - 11
apps/beeswax/gen-py/hive_metastore/ThriftHiveMetastore-remote

@@ -21,10 +21,12 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
   print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
   print ''
   print 'Functions:'
-  print '  bool create_database(string name, string description)'
+  print '  void create_database(Database database)'
   print '  Database get_database(string name)'
-  print '  bool drop_database(string name)'
-  print '   get_databases()'
+  print '  void drop_database(string name, bool deleteData)'
+  print '   get_databases(string pattern)'
+  print '   get_all_databases()'
+  print '  void alter_database(string dbname, Database db)'
   print '  Type get_type(string name)'
   print '  bool create_type(Type type)'
   print '  bool drop_type(string type)'
@@ -34,16 +36,48 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
   print '  void create_table(Table tbl)'
   print '  void drop_table(string dbname, string name, bool deleteData)'
   print '   get_tables(string db_name, string pattern)'
+  print '   get_all_tables(string db_name)'
   print '  Table get_table(string dbname, string tbl_name)'
   print '  void alter_table(string dbname, string tbl_name, Table new_tbl)'
   print '  Partition add_partition(Partition new_part)'
   print '  Partition append_partition(string db_name, string tbl_name,  part_vals)'
+  print '  Partition append_partition_by_name(string db_name, string tbl_name, string part_name)'
   print '  bool drop_partition(string db_name, string tbl_name,  part_vals, bool deleteData)'
+  print '  bool drop_partition_by_name(string db_name, string tbl_name, string part_name, bool deleteData)'
   print '  Partition get_partition(string db_name, string tbl_name,  part_vals)'
+  print '  Partition get_partition_with_auth(string db_name, string tbl_name,  part_vals, string user_name,  group_names)'
+  print '  Partition get_partition_by_name(string db_name, string tbl_name, string part_name)'
   print '   get_partitions(string db_name, string tbl_name, i16 max_parts)'
+  print '   get_partitions_with_auth(string db_name, string tbl_name, i16 max_parts, string user_name,  group_names)'
   print '   get_partition_names(string db_name, string tbl_name, i16 max_parts)'
+  print '   get_partitions_ps(string db_name, string tbl_name,  part_vals, i16 max_parts)'
+  print '   get_partitions_ps_with_auth(string db_name, string tbl_name,  part_vals, i16 max_parts, string user_name,  group_names)'
+  print '   get_partition_names_ps(string db_name, string tbl_name,  part_vals, i16 max_parts)'
+  print '   get_partitions_by_filter(string db_name, string tbl_name, string filter, i16 max_parts)'
   print '  void alter_partition(string db_name, string tbl_name, Partition new_part)'
   print '  string get_config_value(string name, string defaultValue)'
+  print '   partition_name_to_vals(string part_name)'
+  print '   partition_name_to_spec(string part_name)'
+  print '  Index add_index(Index new_index, Table index_table)'
+  print '  void alter_index(string dbname, string base_tbl_name, string idx_name, Index new_idx)'
+  print '  bool drop_index_by_name(string db_name, string tbl_name, string index_name, bool deleteData)'
+  print '  Index get_index_by_name(string db_name, string tbl_name, string index_name)'
+  print '   get_indexes(string db_name, string tbl_name, i16 max_indexes)'
+  print '   get_index_names(string db_name, string tbl_name, i16 max_indexes)'
+  print '  bool create_role(Role role)'
+  print '  bool drop_role(string role_name)'
+  print '   get_role_names()'
+  print '  bool grant_role(string role_name, string principal_name, PrincipalType principal_type, string grantor, PrincipalType grantorType, bool grant_option)'
+  print '  bool revoke_role(string role_name, string principal_name, PrincipalType principal_type)'
+  print '   list_roles(string principal_name, PrincipalType principal_type)'
+  print '  PrincipalPrivilegeSet get_privilege_set(HiveObjectRef hiveObject, string user_name,  group_names)'
+  print '   list_privileges(string principal_name, PrincipalType principal_type, HiveObjectRef hiveObject)'
+  print '  bool grant_privileges(PrivilegeBag privileges)'
+  print '  bool revoke_privileges(PrivilegeBag privileges)'
+  print '  string get_delegation_token(string renewer_kerberos_principal_name)'
+  print '  string get_delegation_token_with_signature(string renewer_kerberos_principal_name, string token_signature)'
+  print '  i64 renew_delegation_token(string token_str_form)'
+  print '  void cancel_delegation_token(string token_str_form)'
   print ''
   sys.exit(0)
 
@@ -95,10 +129,10 @@ client = ThriftHiveMetastore.Client(protocol)
 transport.open()
 
 if cmd == 'create_database':
-  if len(args) != 2:
-    print 'create_database requires 2 args'
+  if len(args) != 1:
+    print 'create_database requires 1 args'
     sys.exit(1)
-  pp.pprint(client.create_database(args[0],args[1],))
+  pp.pprint(client.create_database(eval(args[0]),))
 
 elif cmd == 'get_database':
   if len(args) != 1:
@@ -107,16 +141,28 @@ elif cmd == 'get_database':
   pp.pprint(client.get_database(args[0],))
 
 elif cmd == 'drop_database':
-  if len(args) != 1:
-    print 'drop_database requires 1 args'
+  if len(args) != 2:
+    print 'drop_database requires 2 args'
     sys.exit(1)
-  pp.pprint(client.drop_database(args[0],))
+  pp.pprint(client.drop_database(args[0],eval(args[1]),))
 
 elif cmd == 'get_databases':
+  if len(args) != 1:
+    print 'get_databases requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_databases(args[0],))
+
+elif cmd == 'get_all_databases':
   if len(args) != 0:
-    print 'get_databases requires 0 args'
+    print 'get_all_databases requires 0 args'
     sys.exit(1)
-  pp.pprint(client.get_databases())
+  pp.pprint(client.get_all_databases())
+
+elif cmd == 'alter_database':
+  if len(args) != 2:
+    print 'alter_database requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.alter_database(args[0],eval(args[1]),))
 
 elif cmd == 'get_type':
   if len(args) != 1:
@@ -172,6 +218,12 @@ elif cmd == 'get_tables':
     sys.exit(1)
   pp.pprint(client.get_tables(args[0],args[1],))
 
+elif cmd == 'get_all_tables':
+  if len(args) != 1:
+    print 'get_all_tables requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_all_tables(args[0],))
+
 elif cmd == 'get_table':
   if len(args) != 2:
     print 'get_table requires 2 args'
@@ -196,30 +248,84 @@ elif cmd == 'append_partition':
     sys.exit(1)
   pp.pprint(client.append_partition(args[0],args[1],eval(args[2]),))
 
+elif cmd == 'append_partition_by_name':
+  if len(args) != 3:
+    print 'append_partition_by_name requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.append_partition_by_name(args[0],args[1],args[2],))
+
 elif cmd == 'drop_partition':
   if len(args) != 4:
     print 'drop_partition requires 4 args'
     sys.exit(1)
   pp.pprint(client.drop_partition(args[0],args[1],eval(args[2]),eval(args[3]),))
 
+elif cmd == 'drop_partition_by_name':
+  if len(args) != 4:
+    print 'drop_partition_by_name requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.drop_partition_by_name(args[0],args[1],args[2],eval(args[3]),))
+
 elif cmd == 'get_partition':
   if len(args) != 3:
     print 'get_partition requires 3 args'
     sys.exit(1)
   pp.pprint(client.get_partition(args[0],args[1],eval(args[2]),))
 
+elif cmd == 'get_partition_with_auth':
+  if len(args) != 5:
+    print 'get_partition_with_auth requires 5 args'
+    sys.exit(1)
+  pp.pprint(client.get_partition_with_auth(args[0],args[1],eval(args[2]),args[3],eval(args[4]),))
+
+elif cmd == 'get_partition_by_name':
+  if len(args) != 3:
+    print 'get_partition_by_name requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_partition_by_name(args[0],args[1],args[2],))
+
 elif cmd == 'get_partitions':
   if len(args) != 3:
     print 'get_partitions requires 3 args'
     sys.exit(1)
   pp.pprint(client.get_partitions(args[0],args[1],eval(args[2]),))
 
+elif cmd == 'get_partitions_with_auth':
+  if len(args) != 5:
+    print 'get_partitions_with_auth requires 5 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions_with_auth(args[0],args[1],eval(args[2]),args[3],eval(args[4]),))
+
 elif cmd == 'get_partition_names':
   if len(args) != 3:
     print 'get_partition_names requires 3 args'
     sys.exit(1)
   pp.pprint(client.get_partition_names(args[0],args[1],eval(args[2]),))
 
+elif cmd == 'get_partitions_ps':
+  if len(args) != 4:
+    print 'get_partitions_ps requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions_ps(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'get_partitions_ps_with_auth':
+  if len(args) != 6:
+    print 'get_partitions_ps_with_auth requires 6 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions_ps_with_auth(args[0],args[1],eval(args[2]),eval(args[3]),args[4],eval(args[5]),))
+
+elif cmd == 'get_partition_names_ps':
+  if len(args) != 4:
+    print 'get_partition_names_ps requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.get_partition_names_ps(args[0],args[1],eval(args[2]),eval(args[3]),))
+
+elif cmd == 'get_partitions_by_filter':
+  if len(args) != 4:
+    print 'get_partitions_by_filter requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.get_partitions_by_filter(args[0],args[1],args[2],eval(args[3]),))
+
 elif cmd == 'alter_partition':
   if len(args) != 3:
     print 'alter_partition requires 3 args'
@@ -232,6 +338,138 @@ elif cmd == 'get_config_value':
     sys.exit(1)
   pp.pprint(client.get_config_value(args[0],args[1],))
 
+elif cmd == 'partition_name_to_vals':
+  if len(args) != 1:
+    print 'partition_name_to_vals requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.partition_name_to_vals(args[0],))
+
+elif cmd == 'partition_name_to_spec':
+  if len(args) != 1:
+    print 'partition_name_to_spec requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.partition_name_to_spec(args[0],))
+
+elif cmd == 'add_index':
+  if len(args) != 2:
+    print 'add_index requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.add_index(eval(args[0]),eval(args[1]),))
+
+elif cmd == 'alter_index':
+  if len(args) != 4:
+    print 'alter_index requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.alter_index(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'drop_index_by_name':
+  if len(args) != 4:
+    print 'drop_index_by_name requires 4 args'
+    sys.exit(1)
+  pp.pprint(client.drop_index_by_name(args[0],args[1],args[2],eval(args[3]),))
+
+elif cmd == 'get_index_by_name':
+  if len(args) != 3:
+    print 'get_index_by_name requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_index_by_name(args[0],args[1],args[2],))
+
+elif cmd == 'get_indexes':
+  if len(args) != 3:
+    print 'get_indexes requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_indexes(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'get_index_names':
+  if len(args) != 3:
+    print 'get_index_names requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_index_names(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'create_role':
+  if len(args) != 1:
+    print 'create_role requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.create_role(eval(args[0]),))
+
+elif cmd == 'drop_role':
+  if len(args) != 1:
+    print 'drop_role requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.drop_role(args[0],))
+
+elif cmd == 'get_role_names':
+  if len(args) != 0:
+    print 'get_role_names requires 0 args'
+    sys.exit(1)
+  pp.pprint(client.get_role_names())
+
+elif cmd == 'grant_role':
+  if len(args) != 6:
+    print 'grant_role requires 6 args'
+    sys.exit(1)
+  pp.pprint(client.grant_role(args[0],args[1],eval(args[2]),args[3],eval(args[4]),eval(args[5]),))
+
+elif cmd == 'revoke_role':
+  if len(args) != 3:
+    print 'revoke_role requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.revoke_role(args[0],args[1],eval(args[2]),))
+
+elif cmd == 'list_roles':
+  if len(args) != 2:
+    print 'list_roles requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.list_roles(args[0],eval(args[1]),))
+
+elif cmd == 'get_privilege_set':
+  if len(args) != 3:
+    print 'get_privilege_set requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.get_privilege_set(eval(args[0]),args[1],eval(args[2]),))
+
+elif cmd == 'list_privileges':
+  if len(args) != 3:
+    print 'list_privileges requires 3 args'
+    sys.exit(1)
+  pp.pprint(client.list_privileges(args[0],eval(args[1]),eval(args[2]),))
+
+elif cmd == 'grant_privileges':
+  if len(args) != 1:
+    print 'grant_privileges requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.grant_privileges(eval(args[0]),))
+
+elif cmd == 'revoke_privileges':
+  if len(args) != 1:
+    print 'revoke_privileges requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.revoke_privileges(eval(args[0]),))
+
+elif cmd == 'get_delegation_token':
+  if len(args) != 1:
+    print 'get_delegation_token requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.get_delegation_token(args[0],))
+
+elif cmd == 'get_delegation_token_with_signature':
+  if len(args) != 2:
+    print 'get_delegation_token_with_signature requires 2 args'
+    sys.exit(1)
+  pp.pprint(client.get_delegation_token_with_signature(args[0],args[1],))
+
+elif cmd == 'renew_delegation_token':
+  if len(args) != 1:
+    print 'renew_delegation_token requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.renew_delegation_token(args[0],))
+
+elif cmd == 'cancel_delegation_token':
+  if len(args) != 1:
+    print 'cancel_delegation_token requires 1 args'
+    sys.exit(1)
+  pp.pprint(client.cancel_delegation_token(args[0],))
+
 else:
   print 'Unrecognized method %s' % cmd
   sys.exit(1)

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1673 - 122
apps/beeswax/gen-py/hive_metastore/ThriftHiveMetastore.py


+ 3 - 0
apps/beeswax/gen-py/hive_metastore/constants.py

@@ -8,6 +8,8 @@ from thrift.Thrift import *
 from ttypes import *
 
 DDL_TIME = "transient_lastDdlTime"
+IS_ARCHIVED = "is_archived"
+ORIGINAL_LOCATION = "original_location"
 META_TABLE_COLUMNS = "columns"
 META_TABLE_COLUMN_TYPES = "columns.types"
 BUCKET_FIELD_NAME = "bucket_field_name"
@@ -20,3 +22,4 @@ META_TABLE_SERDE = "serde"
 META_TABLE_PARTITION_COLUMNS = "partition_columns"
 FILE_INPUT_FORMAT = "file.inputformat"
 FILE_OUTPUT_FORMAT = "file.outputformat"
+META_TABLE_STORAGE = "storage_handler"

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 777 - 96
apps/beeswax/gen-py/hive_metastore/ttypes.py


+ 198 - 21
apps/beeswax/thrift/include/hive_metastore.thrift

@@ -44,10 +44,66 @@ struct Type {
   4: optional list<FieldSchema> fields // if the name is one of the user defined types
 }
 
+enum HiveObjectType {
+  GLOBAL = 1,
+  DATABASE = 2,
+  TABLE = 3,
+  PARTITION = 4,
+  COLUMN = 5,
+}
+
+enum PrincipalType {
+  USER = 1,
+  ROLE = 2,
+  GROUP = 3,
+}
+
+struct HiveObjectRef{
+  1: HiveObjectType objectType,
+  2: string dbName,
+  3: string objectName,
+  4: list<string> partValues,
+  5: string columnName,
+}
+
+struct PrivilegeGrantInfo {
+  1: string privilege,
+  2: i32 createTime,
+  3: string grantor,
+  4: PrincipalType grantorType,
+  5: bool grantOption,
+}
+
+struct HiveObjectPrivilege {
+  1: HiveObjectRef  hiveObject,
+  2: string principalName,
+  3: PrincipalType principalType,
+  4: PrivilegeGrantInfo grantInfo,
+}
+
+struct PrivilegeBag {
+  1: list<HiveObjectPrivilege> privileges,
+}
+
+struct PrincipalPrivilegeSet {
+  1: map<string, list<PrivilegeGrantInfo>> userPrivileges, // user name -> privilege grant info
+  2: map<string, list<PrivilegeGrantInfo>> groupPrivileges, // group name -> privilege grant info
+  3: map<string, list<PrivilegeGrantInfo>> rolePrivileges, //role name -> privilege grant info
+}
+
+struct Role {
+  1: string roleName,
+  2: i32 createTime,
+  3: string ownerName,
+}
+
 // namespace for tables
 struct Database {
   1: string name,
   2: string description,
+  3: string locationUri,
+  4: map<string, string> parameters, // properties associated with the database
+  5: optional PrincipalPrivilegeSet privileges
 }
 
 // This object holds the information needed by SerDes
@@ -87,7 +143,11 @@ struct Table {
   6: i32    retention,                // retention time
   7: StorageDescriptor sd,            // storage descriptor of the table
   8: list<FieldSchema> partitionKeys, // partition keys of the table. only primitive types are supported
-  9: map<string, string> parameters   // to store comments or any other user level parameters
+  9: map<string, string> parameters,   // to store comments or any other user level parameters
+  10: string viewOriginalText,         // original view text, null for non-view
+  11: string viewExpandedText,         // expanded view text, null for non-view
+  12: string tableType,                 // table type enum, e.g. EXTERNAL_TABLE
+  13: optional PrincipalPrivilegeSet privileges,
 }
 
 struct Partition {
@@ -97,18 +157,21 @@ struct Partition {
   4: i32          createTime,
   5: i32          lastAccessTime,
   6: StorageDescriptor   sd,
-  7: map<string, string> parameters
+  7: map<string, string> parameters,
+  8: optional PrincipalPrivilegeSet privileges
 }
 
-// index on a hive table is also another table whose columns are the subset of the base table columns along with the offset
-// this will automatically generate table (table_name_index_name)
 struct Index {
   1: string       indexName, // unique with in the whole database namespace
-  2: i32          indexType, // reserved
-  3: string       tableName,
-  4: string       dbName,
-  5: list<string> colNames,  // for now columns will be sorted in the ascending order
-  6: string       partName   // partition name
+  2: string       indexHandlerClass, // reserved
+  3: string       dbName,
+  4: string       origTableName,
+  5: i32          createTime,
+  6: i32          lastAccessTime,
+  7: string       indexTableName,
+  8: StorageDescriptor   sd,
+  9: map<string, string> parameters,
+  10: bool         deferredRebuild
 }
 
 // schema of the table/query results etc.
@@ -118,7 +181,6 @@ struct Schema {
  2: map<string, string> properties
 }
 
-
 exception MetaException {
   1: string message
 }
@@ -160,16 +222,17 @@ exception ConfigValSecurityException {
 */
 service ThriftHiveMetastore extends fb303.FacebookService
 {
-  bool create_database(1:string name, 2:string description)
-                                       throws(1:AlreadyExistsException o1, 2:MetaException o2)
+  void create_database(1:Database database) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3)
   Database get_database(1:string name) throws(1:NoSuchObjectException o1, 2:MetaException o2)
-  bool drop_database(1:string name)    throws(2:MetaException o2)
-  list<string> get_databases()         throws(1:MetaException o1)
-
+  void drop_database(1:string name, 2:bool deleteData) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3)
+  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 o2)
+  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)
-  bool drop_type(1:string type) throws(1:MetaException o2)
+  bool drop_type(1:string type) throws(1:MetaException o1, 2:NoSuchObjectException o2)
   map<string, Type> get_type_all(1:string name)
                                 throws(1:MetaException o2)
 
@@ -187,38 +250,77 @@ service ThriftHiveMetastore extends fb303.FacebookService
   // sd.inputFormat  (SequenceFileInputFormat (binary like falcon tables or u_full) or TextInputFormat)
   // sd.outputFormat (SequenceFileInputFormat (binary) or TextInputFormat)
   // sd.serdeInfo.serializationLib (SerDe class name eg org.apache.hadoop.hive.serde.simple_meta.MetadataTypedColumnsetSerDe
+  // * See notes on DDL_TIME
   void create_table(1:Table tbl) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4)
   // drops the table and all the partitions associated with it if the table has partitions
   // delete data (including partitions) if deleteData is set to true
   void drop_table(1:string dbname, 2:string name, 3:bool deleteData)
                        throws(1:NoSuchObjectException o1, 2:MetaException o3)
-  list<string> get_tables(1: string db_name, 2: string pattern)
-                       throws (1: MetaException o1)
+  list<string> get_tables(1: string db_name, 2: string pattern) throws (1: MetaException o1)
+  list<string> get_all_tables(1: string db_name) throws (1: MetaException o1)
 
   Table get_table(1:string dbname, 2:string tbl_name)
                        throws (1:MetaException o1, 2:NoSuchObjectException o2)
   // alter table applies to only future partitions not for existing partitions
+  // * See notes on DDL_TIME
   void alter_table(1:string dbname, 2:string tbl_name, 3:Table new_tbl)
                        throws (1:InvalidOperationException o1, 2:MetaException o2)
 
   // the following applies to only tables that have partitions
+  // * See notes on DDL_TIME
   Partition add_partition(1:Partition new_part)
                        throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
   Partition append_partition(1:string db_name, 2:string tbl_name, 3:list<string> part_vals)
                        throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
+  Partition append_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name)
+                       throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)
   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) 
   Partition get_partition(1:string db_name, 2:string tbl_name, 3:list<string> part_vals)
-                       throws(1:MetaException o1)
+                       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, 
+      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)
+                       throws(1:MetaException o1, 2:NoSuchObjectException o2)
+
   // returns all the partitions for this table in reverse chronological order.
-  // if max parts is given then it will return only that many
+  // 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<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 
+  // 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 
+  	3:list<string> part_vals, 4:i16 max_parts=-1)
+                       throws(1:MetaException o1)
+  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)
+
+  // get the partitions matching the given partition filter
+  list<Partition> get_partitions_by_filter(1:string db_name 2:string tbl_name
+    3:string filter, 4:i16 max_parts=-1)
+                       throws(1:MetaException o1, 2:NoSuchObjectException o2)
 
   // changes the partition to the new partition object. partition is identified from the part values
   // in the new_part
+  // * See notes on DDL_TIME
   void alter_partition(1:string db_name, 2:string tbl_name, 3:Partition new_part)
                        throws(1:InvalidOperationException o1, 2:MetaException o2)
 
@@ -228,8 +330,81 @@ service ThriftHiveMetastore extends fb303.FacebookService
   // 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)
+  // converts a partition name into a partition specification (a mapping from
+  // the partition cols to the values)
+  map<string, string> partition_name_to_spec(1: string part_name)
+                          throws(1: MetaException o1)
+  
+  //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) 
+  Index get_index_by_name(1:string db_name 2:string tbl_name, 3:string index_name)
+                       throws(1:MetaException o1, 2:NoSuchObjectException o2)
+
+  list<Index> get_indexes(1:string db_name, 2:string tbl_name, 3:i16 max_indexes=-1)
+                       throws(1:NoSuchObjectException o1, 2:MetaException o2)
+  list<string> get_index_names(1:string db_name, 2:string tbl_name, 3:i16 max_indexes=-1)
+                       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, 
+    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) 
+                        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, 
+    3: list<string> group_names) throws(1:MetaException o1)
+  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)
+  
+  //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 renewer_kerberos_principal_name) throws (1:MetaException o1)
+
+  // get metastore server delegation token for use from the map/reduce tasks to authenticate
+  // to metastore server - this method takes an extra token signature string which is just
+  // an identifier to associate with the token - this will be used by the token selector code
+  // to pick the right token given the associated identifier.
+  string get_delegation_token_with_signature(1:string renewer_kerberos_principal_name, 
+    2:string token_signature) throws (1:MetaException o1)
+
+  // method to renew delegation token obtained from metastore server
+  i64 renew_delegation_token(1:string token_str_form) throws (1:MetaException o1)
+
+  // method to cancel delegation token obtained from metastore server
+  void cancel_delegation_token(1:string token_str_form) throws (1:MetaException o1)
 }
 
+// * Note about the DDL_TIME: When creating or altering a table or a partition,
+// if the DDL_TIME is not set, the current time will be used.
+
+// For storing info about archived partitions in parameters
+
+// Whether the partition is archived
+const string IS_ARCHIVED = "is_archived",
+// The original location of the partition, before archiving. After archiving,
+// this directory will contain the archive. When the partition
+// is dropped, this directory will be deleted
+const string ORIGINAL_LOCATION = "original_location",
+
 // these should be needed only for backward compatibility with filestore
 const string META_TABLE_COLUMNS   = "columns",
 const string META_TABLE_COLUMN_TYPES   = "columns.types",
@@ -243,5 +418,7 @@ const string META_TABLE_SERDE     = "serde",
 const string META_TABLE_PARTITION_COLUMNS = "partition_columns",
 const string FILE_INPUT_FORMAT    = "file.inputformat",
 const string FILE_OUTPUT_FORMAT   = "file.outputformat",
+const string META_TABLE_STORAGE   = "storage_handler",
+
 
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.