HIVE-13351: Support drop Primary Key/Foreign Key constraints (Hari Subramaniyan, reviewed by Ashutosh Chauhan)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/212077b8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/212077b8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/212077b8 Branch: refs/heads/java8 Commit: 212077b8ae4aed130d8fea38febfc86c2bc55bbb Parents: b04dc95 Author: Hari Subramaniyan <harisan...@apache.org> Authored: Wed May 4 12:26:38 2016 -0700 Committer: Hari Subramaniyan <harisan...@apache.org> Committed: Wed May 4 12:26:38 2016 -0700 ---------------------------------------------------------------------- metastore/if/hive_metastore.thrift | 8 + .../gen/thrift/gen-cpp/ThriftHiveMetastore.cpp | 2431 ++++++++++-------- .../gen/thrift/gen-cpp/ThriftHiveMetastore.h | 133 + .../ThriftHiveMetastore_server.skeleton.cpp | 5 + .../gen/thrift/gen-cpp/hive_metastore_types.cpp | 2180 ++++++++-------- .../gen/thrift/gen-cpp/hive_metastore_types.h | 52 + .../metastore/api/DropConstraintRequest.java | 591 +++++ .../hive/metastore/api/ThriftHiveMetastore.java | 1966 ++++++++++---- .../gen-php/metastore/ThriftHiveMetastore.php | 242 ++ .../src/gen/thrift/gen-php/metastore/Types.php | 121 + .../hive_metastore/ThriftHiveMetastore-remote | 7 + .../hive_metastore/ThriftHiveMetastore.py | 212 ++ .../gen/thrift/gen-py/hive_metastore/ttypes.py | 97 + .../gen/thrift/gen-rb/hive_metastore_types.rb | 23 + .../gen/thrift/gen-rb/thrift_hive_metastore.rb | 63 + .../hadoop/hive/metastore/HiveMetaStore.java | 29 + .../hive/metastore/HiveMetaStoreClient.java | 6 + .../hadoop/hive/metastore/IMetaStoreClient.java | 3 + .../hadoop/hive/metastore/ObjectStore.java | 46 +- .../apache/hadoop/hive/metastore/RawStore.java | 2 + .../hadoop/hive/metastore/hbase/HBaseStore.java | 6 + .../DummyRawStoreControlledCommit.java | 6 + .../DummyRawStoreForJdoConnection.java | 6 + .../org/apache/hadoop/hive/ql/exec/DDLTask.java | 21 +- .../hadoop/hive/ql/hooks/WriteEntity.java | 3 +- .../apache/hadoop/hive/ql/metadata/Hive.java | 9 + .../hive/ql/parse/DDLSemanticAnalyzer.java | 13 +- .../apache/hadoop/hive/ql/parse/HiveParser.g | 9 + .../hive/ql/parse/SemanticAnalyzerFactory.java | 2 + .../hadoop/hive/ql/plan/AlterTableDesc.java | 25 +- .../hadoop/hive/ql/plan/HiveOperation.java | 2 + .../clientnegative/drop_invalid_constraint1.q | 3 + .../clientnegative/drop_invalid_constraint2.q | 2 + .../clientnegative/drop_invalid_constraint3.q | 2 + .../clientnegative/drop_invalid_constraint4.q | 3 + .../clientpositive/create_with_constraints.q | 12 + .../drop_invalid_constraint1.q.out | 15 + .../drop_invalid_constraint2.q.out | 11 + .../drop_invalid_constraint3.q.out | 11 + .../drop_invalid_constraint4.q.out | 19 + .../create_with_constraints.q.out | 68 + service/src/gen/thrift/gen-py/__init__.py | 0 42 files changed, 5925 insertions(+), 2540 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/212077b8/metastore/if/hive_metastore.thrift ---------------------------------------------------------------------- diff --git a/metastore/if/hive_metastore.thrift b/metastore/if/hive_metastore.thrift index acebf7a..c8d78b6 100755 --- a/metastore/if/hive_metastore.thrift +++ b/metastore/if/hive_metastore.thrift @@ -487,6 +487,11 @@ struct ForeignKeysResponse { 1: required list<SQLForeignKey> foreignKeys } +struct DropConstraintRequest { + 1: required string dbname, + 2: required string tablename, + 3: required string constraintname +} // Return type for get_partitions_by_expr struct PartitionsByExprResult { @@ -993,6 +998,9 @@ service ThriftHiveMetastore extends fb303.FacebookService throws (1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4) + void drop_constraint(1:DropConstraintRequest req) + throws(1:NoSuchObjectException o1, 2:MetaException o3) + // 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)