This is an automated email from the ASF dual-hosted git repository. kgyrtkirk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push: new decd725 HIVE-25782: Added client capabilites in the dry run call for the CTAS… (#2858) (Sai Hemanth Gantasala reviewed by Zoltan Haindrich) decd725 is described below commit decd725f2b29c37fa265edfc7899623c99916d61 Author: Sai Hemanth Gantasala <68923650+saihemanth-cloud...@users.noreply.github.com> AuthorDate: Wed Dec 15 22:57:41 2021 -0800 HIVE-25782: Added client capabilites in the dry run call for the CTAS… (#2858) (Sai Hemanth Gantasala reviewed by Zoltan Haindrich) --- .../create_acid_table_with_transformer.q | 7 + .../llap/create_acid_table_with_transformer.q.out | 11 ++ .../src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp | 30 ++--- .../src/gen/thrift/gen-cpp/ThriftHiveMetastore.h | 30 ++--- .../ThriftHiveMetastore_server.skeleton.cpp | 2 +- .../hive/metastore/api/ThriftHiveMetastore.java | 146 ++++++++++----------- .../metastore/ThriftHiveMetastoreClient.php | 8 +- .../gen-php/metastore/ThriftHiveMetastoreIf.php | 4 +- ...ftHiveMetastore_translate_table_dryrun_args.php | 24 ++-- .../hive_metastore/ThriftHiveMetastore-remote | 2 +- .../gen-py/hive_metastore/ThriftHiveMetastore.py | 34 ++--- .../src/gen/thrift/gen-rb/thrift_hive_metastore.rb | 14 +- .../hadoop/hive/metastore/HiveMetaStoreClient.java | 8 +- .../src/main/thrift/hive_metastore.thrift | 3 +- .../apache/hadoop/hive/metastore/HMSHandler.java | 7 +- .../metastore/HiveMetaStoreClientPreCatalog.java | 3 +- 16 files changed, 181 insertions(+), 152 deletions(-) diff --git a/ql/src/test/queries/clientpositive/create_acid_table_with_transformer.q b/ql/src/test/queries/clientpositive/create_acid_table_with_transformer.q new file mode 100644 index 0000000..2547549 --- /dev/null +++ b/ql/src/test/queries/clientpositive/create_acid_table_with_transformer.q @@ -0,0 +1,7 @@ +set hive.support.concurrency=true; +set hive.exec.dynamic.partition.mode=nonstrict; +set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; +set metastore.metadata.transformer.class=org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer; +set hive.metastore.client.capabilities=HIVEFULLACIDREAD,HIVEFULLACIDWRITE,HIVECACHEINVALIDATE,HIVEMANAGESTATS,HIVEMANAGEDINSERTWRITE,HIVEMANAGEDINSERTREAD; + +create table test stored as orc tblproperties ('transactional'='true') as select from_unixtime(unix_timestamp("0002-01-01 09:57:21", "yyyy-MM-dd HH:mm:ss")); diff --git a/ql/src/test/results/clientpositive/llap/create_acid_table_with_transformer.q.out b/ql/src/test/results/clientpositive/llap/create_acid_table_with_transformer.q.out new file mode 100644 index 0000000..550a020 --- /dev/null +++ b/ql/src/test/results/clientpositive/llap/create_acid_table_with_transformer.q.out @@ -0,0 +1,11 @@ +PREHOOK: query: create table test stored as orc tblproperties ('transactional'='true') as select from_unixtime(unix_timestamp("0002-01-01 09:57:21", "yyyy-MM-dd HH:mm:ss")) +PREHOOK: type: CREATETABLE_AS_SELECT +PREHOOK: Input: _dummy_database@_dummy_table +PREHOOK: Output: database:default +PREHOOK: Output: default@test +POSTHOOK: query: create table test stored as orc tblproperties ('transactional'='true') as select from_unixtime(unix_timestamp("0002-01-01 09:57:21", "yyyy-MM-dd HH:mm:ss")) +POSTHOOK: type: CREATETABLE_AS_SELECT +POSTHOOK: Input: _dummy_database@_dummy_table +POSTHOOK: Output: database:default +POSTHOOK: Output: default@test +POSTHOOK: Lineage: test._c0 SIMPLE [] diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp index b07edc8..d08962f 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp @@ -9684,8 +9684,8 @@ uint32_t ThriftHiveMetastore_translate_table_dryrun_args::read(::apache::thrift: { case 1: if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->tbl.read(iprot); - this->__isset.tbl = true; + xfer += this->request.read(iprot); + this->__isset.request = true; } else { xfer += iprot->skip(ftype); } @@ -9707,8 +9707,8 @@ uint32_t ThriftHiveMetastore_translate_table_dryrun_args::write(::apache::thrift ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); xfer += oprot->writeStructBegin("ThriftHiveMetastore_translate_table_dryrun_args"); - xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->tbl.write(oprot); + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->request.write(oprot); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); @@ -9726,8 +9726,8 @@ uint32_t ThriftHiveMetastore_translate_table_dryrun_pargs::write(::apache::thrif ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); xfer += oprot->writeStructBegin("ThriftHiveMetastore_translate_table_dryrun_pargs"); - xfer += oprot->writeFieldBegin("tbl", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += (*(this->tbl)).write(oprot); + xfer += oprot->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->request)).write(oprot); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); @@ -65539,19 +65539,19 @@ void ThriftHiveMetastoreClient::recv_add_check_constraint() return; } -void ThriftHiveMetastoreClient::translate_table_dryrun(Table& _return, const Table& tbl) +void ThriftHiveMetastoreClient::translate_table_dryrun(Table& _return, const CreateTableRequest& request) { - send_translate_table_dryrun(tbl); + send_translate_table_dryrun(request); recv_translate_table_dryrun(_return); } -void ThriftHiveMetastoreClient::send_translate_table_dryrun(const Table& tbl) +void ThriftHiveMetastoreClient::send_translate_table_dryrun(const CreateTableRequest& request) { int32_t cseqid = 0; oprot_->writeMessageBegin("translate_table_dryrun", ::apache::thrift::protocol::T_CALL, cseqid); ThriftHiveMetastore_translate_table_dryrun_pargs args; - args.tbl = &tbl; + args.request = &request; args.write(oprot_); oprot_->writeMessageEnd(); @@ -82174,7 +82174,7 @@ void ThriftHiveMetastoreProcessor::process_translate_table_dryrun(int32_t seqid, ThriftHiveMetastore_translate_table_dryrun_result result; try { - iface_->translate_table_dryrun(result.success, args.tbl); + iface_->translate_table_dryrun(result.success, args.request); result.__isset.success = true; } catch (AlreadyExistsException &o1) { result.o1 = o1; @@ -99115,20 +99115,20 @@ void ThriftHiveMetastoreConcurrentClient::recv_add_check_constraint(const int32_ } // end while(true) } -void ThriftHiveMetastoreConcurrentClient::translate_table_dryrun(Table& _return, const Table& tbl) +void ThriftHiveMetastoreConcurrentClient::translate_table_dryrun(Table& _return, const CreateTableRequest& request) { - int32_t seqid = send_translate_table_dryrun(tbl); + int32_t seqid = send_translate_table_dryrun(request); recv_translate_table_dryrun(_return, seqid); } -int32_t ThriftHiveMetastoreConcurrentClient::send_translate_table_dryrun(const Table& tbl) +int32_t ThriftHiveMetastoreConcurrentClient::send_translate_table_dryrun(const CreateTableRequest& request) { int32_t cseqid = this->sync_->generateSeqId(); ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get()); oprot_->writeMessageBegin("translate_table_dryrun", ::apache::thrift::protocol::T_CALL, cseqid); ThriftHiveMetastore_translate_table_dryrun_pargs args; - args.tbl = &tbl; + args.request = &request; args.write(oprot_); oprot_->writeMessageEnd(); diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h index c2595c6..87fd5fd 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h @@ -66,7 +66,7 @@ class ThriftHiveMetastoreIf : virtual public ::facebook::fb303::FacebookService virtual void add_not_null_constraint(const AddNotNullConstraintRequest& req) = 0; virtual void add_default_constraint(const AddDefaultConstraintRequest& req) = 0; virtual void add_check_constraint(const AddCheckConstraintRequest& req) = 0; - virtual void translate_table_dryrun(Table& _return, const Table& tbl) = 0; + virtual void translate_table_dryrun(Table& _return, const CreateTableRequest& request) = 0; virtual void drop_table(const std::string& dbname, const std::string& name, const bool deleteData) = 0; virtual void drop_table_with_environment_context(const std::string& dbname, const std::string& name, const bool deleteData, const EnvironmentContext& environment_context) = 0; virtual void truncate_table(const std::string& dbName, const std::string& tableName, const std::vector<std::string> & partNames) = 0; @@ -443,7 +443,7 @@ class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual p void add_check_constraint(const AddCheckConstraintRequest& /* req */) { return; } - void translate_table_dryrun(Table& /* _return */, const Table& /* tbl */) { + void translate_table_dryrun(Table& /* _return */, const CreateTableRequest& /* request */) { return; } void drop_table(const std::string& /* dbname */, const std::string& /* name */, const bool /* deleteData */) { @@ -6007,8 +6007,8 @@ class ThriftHiveMetastore_add_check_constraint_presult { }; typedef struct _ThriftHiveMetastore_translate_table_dryrun_args__isset { - _ThriftHiveMetastore_translate_table_dryrun_args__isset() : tbl(false) {} - bool tbl :1; + _ThriftHiveMetastore_translate_table_dryrun_args__isset() : request(false) {} + bool request :1; } _ThriftHiveMetastore_translate_table_dryrun_args__isset; class ThriftHiveMetastore_translate_table_dryrun_args { @@ -6020,15 +6020,15 @@ class ThriftHiveMetastore_translate_table_dryrun_args { } virtual ~ThriftHiveMetastore_translate_table_dryrun_args() noexcept; - Table tbl; + CreateTableRequest request; _ThriftHiveMetastore_translate_table_dryrun_args__isset __isset; - void __set_tbl(const Table& val); + void __set_request(const CreateTableRequest& val); bool operator == (const ThriftHiveMetastore_translate_table_dryrun_args & rhs) const { - if (!(tbl == rhs.tbl)) + if (!(request == rhs.request)) return false; return true; } @@ -6049,7 +6049,7 @@ class ThriftHiveMetastore_translate_table_dryrun_pargs { virtual ~ThriftHiveMetastore_translate_table_dryrun_pargs() noexcept; - const Table* tbl; + const CreateTableRequest* request; uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; @@ -33381,8 +33381,8 @@ class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public void add_check_constraint(const AddCheckConstraintRequest& req); void send_add_check_constraint(const AddCheckConstraintRequest& req); void recv_add_check_constraint(); - void translate_table_dryrun(Table& _return, const Table& tbl); - void send_translate_table_dryrun(const Table& tbl); + void translate_table_dryrun(Table& _return, const CreateTableRequest& request); + void send_translate_table_dryrun(const CreateTableRequest& request); void recv_translate_table_dryrun(Table& _return); void drop_table(const std::string& dbname, const std::string& name, const bool deleteData); void send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData); @@ -35015,13 +35015,13 @@ class ThriftHiveMetastoreMultiface : virtual public ThriftHiveMetastoreIf, publi ifaces_[i]->add_check_constraint(req); } - void translate_table_dryrun(Table& _return, const Table& tbl) { + void translate_table_dryrun(Table& _return, const CreateTableRequest& request) { size_t sz = ifaces_.size(); size_t i = 0; for (; i < (sz - 1); ++i) { - ifaces_[i]->translate_table_dryrun(_return, tbl); + ifaces_[i]->translate_table_dryrun(_return, request); } - ifaces_[i]->translate_table_dryrun(_return, tbl); + ifaces_[i]->translate_table_dryrun(_return, request); return; } @@ -37333,8 +37333,8 @@ class ThriftHiveMetastoreConcurrentClient : virtual public ThriftHiveMetastoreIf void add_check_constraint(const AddCheckConstraintRequest& req); int32_t send_add_check_constraint(const AddCheckConstraintRequest& req); void recv_add_check_constraint(const int32_t seqid); - void translate_table_dryrun(Table& _return, const Table& tbl); - int32_t send_translate_table_dryrun(const Table& tbl); + void translate_table_dryrun(Table& _return, const CreateTableRequest& request); + int32_t send_translate_table_dryrun(const CreateTableRequest& request); void recv_translate_table_dryrun(Table& _return, const int32_t seqid); void drop_table(const std::string& dbname, const std::string& name, const bool deleteData); int32_t send_drop_table(const std::string& dbname, const std::string& name, const bool deleteData); diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp index 864c513..6c56868 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp @@ -220,7 +220,7 @@ class ThriftHiveMetastoreHandler : virtual public ThriftHiveMetastoreIf { printf("add_check_constraint\n"); } - void translate_table_dryrun(Table& _return, const Table& tbl) { + void translate_table_dryrun(Table& _return, const CreateTableRequest& request) { // Your implementation goes here printf("translate_table_dryrun\n"); } diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java index 19e9ae3..aca4b95 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java @@ -95,7 +95,7 @@ package org.apache.hadoop.hive.metastore.api; public void add_check_constraint(AddCheckConstraintRequest req) throws NoSuchObjectException, MetaException, org.apache.thrift.TException; - public Table translate_table_dryrun(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, org.apache.thrift.TException; + public Table translate_table_dryrun(CreateTableRequest request) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, org.apache.thrift.TException; public void drop_table(java.lang.String dbname, java.lang.String name, boolean deleteData) throws NoSuchObjectException, MetaException, org.apache.thrift.TException; @@ -631,7 +631,7 @@ package org.apache.hadoop.hive.metastore.api; public void add_check_constraint(AddCheckConstraintRequest req, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException; - public void translate_table_dryrun(Table tbl, org.apache.thrift.async.AsyncMethodCallback<Table> resultHandler) throws org.apache.thrift.TException; + public void translate_table_dryrun(CreateTableRequest request, org.apache.thrift.async.AsyncMethodCallback<Table> resultHandler) throws org.apache.thrift.TException; public void drop_table(java.lang.String dbname, java.lang.String name, boolean deleteData, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException; @@ -2264,16 +2264,16 @@ package org.apache.hadoop.hive.metastore.api; return; } - public Table translate_table_dryrun(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, org.apache.thrift.TException + public Table translate_table_dryrun(CreateTableRequest request) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, org.apache.thrift.TException { - send_translate_table_dryrun(tbl); + send_translate_table_dryrun(request); return recv_translate_table_dryrun(); } - public void send_translate_table_dryrun(Table tbl) throws org.apache.thrift.TException + public void send_translate_table_dryrun(CreateTableRequest request) throws org.apache.thrift.TException { translate_table_dryrun_args args = new translate_table_dryrun_args(); - args.setTbl(tbl); + args.setRequest(request); sendBase("translate_table_dryrun", args); } @@ -9983,24 +9983,24 @@ package org.apache.hadoop.hive.metastore.api; } } - public void translate_table_dryrun(Table tbl, org.apache.thrift.async.AsyncMethodCallback<Table> resultHandler) throws org.apache.thrift.TException { + public void translate_table_dryrun(CreateTableRequest request, org.apache.thrift.async.AsyncMethodCallback<Table> resultHandler) throws org.apache.thrift.TException { checkReady(); - translate_table_dryrun_call method_call = new translate_table_dryrun_call(tbl, resultHandler, this, ___protocolFactory, ___transport); + translate_table_dryrun_call method_call = new translate_table_dryrun_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class translate_table_dryrun_call extends org.apache.thrift.async.TAsyncMethodCall<Table> { - private Table tbl; - public translate_table_dryrun_call(Table tbl, org.apache.thrift.async.AsyncMethodCallback<Table> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + private CreateTableRequest request; + public translate_table_dryrun_call(CreateTableRequest request, org.apache.thrift.async.AsyncMethodCallback<Table> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); - this.tbl = tbl; + this.request = request; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("translate_table_dryrun", org.apache.thrift.protocol.TMessageType.CALL, 0)); translate_table_dryrun_args args = new translate_table_dryrun_args(); - args.setTbl(tbl); + args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } @@ -19246,7 +19246,7 @@ package org.apache.hadoop.hive.metastore.api; public translate_table_dryrun_result getResult(I iface, translate_table_dryrun_args args) throws org.apache.thrift.TException { translate_table_dryrun_result result = new translate_table_dryrun_result(); try { - result.success = iface.translate_table_dryrun(args.tbl); + result.success = iface.translate_table_dryrun(args.request); } catch (AlreadyExistsException o1) { result.o1 = o1; } catch (InvalidObjectException o2) { @@ -29222,7 +29222,7 @@ package org.apache.hadoop.hive.metastore.api; } public void start(I iface, translate_table_dryrun_args args, org.apache.thrift.async.AsyncMethodCallback<Table> resultHandler) throws org.apache.thrift.TException { - iface.translate_table_dryrun(args.tbl,resultHandler); + iface.translate_table_dryrun(args.request,resultHandler); } } @@ -83976,16 +83976,16 @@ package org.apache.hadoop.hive.metastore.api; @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public static class translate_table_dryrun_args implements org.apache.thrift.TBase<translate_table_dryrun_args, translate_table_dryrun_args._Fields>, java.io.Serializable, Cloneable, Comparable<translate_table_dryrun_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("translate_table_dryrun_args"); - private static final org.apache.thrift.protocol.TField TBL_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new translate_table_dryrun_argsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new translate_table_dryrun_argsTupleSchemeFactory(); - private @org.apache.thrift.annotation.Nullable Table tbl; // required + private @org.apache.thrift.annotation.Nullable CreateTableRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - TBL((short)1, "tbl"); + REQUEST((short)1, "request"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); @@ -84001,8 +84001,8 @@ package org.apache.hadoop.hive.metastore.api; @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // TBL - return TBL; + case 1: // REQUEST + return REQUEST; default: return null; } @@ -84047,8 +84047,8 @@ package org.apache.hadoop.hive.metastore.api; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TBL, new org.apache.thrift.meta_data.FieldMetaData("tbl", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Table.class))); + tmpMap.put(_Fields.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CreateTableRequest.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(translate_table_dryrun_args.class, metaDataMap); } @@ -84057,18 +84057,18 @@ package org.apache.hadoop.hive.metastore.api; } public translate_table_dryrun_args( - Table tbl) + CreateTableRequest request) { this(); - this.tbl = tbl; + this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public translate_table_dryrun_args(translate_table_dryrun_args other) { - if (other.isSetTbl()) { - this.tbl = new Table(other.tbl); + if (other.isSetRequest()) { + this.request = new CreateTableRequest(other.request); } } @@ -84078,40 +84078,40 @@ package org.apache.hadoop.hive.metastore.api; @Override public void clear() { - this.tbl = null; + this.request = null; } @org.apache.thrift.annotation.Nullable - public Table getTbl() { - return this.tbl; + public CreateTableRequest getRequest() { + return this.request; } - public void setTbl(@org.apache.thrift.annotation.Nullable Table tbl) { - this.tbl = tbl; + public void setRequest(@org.apache.thrift.annotation.Nullable CreateTableRequest request) { + this.request = request; } - public void unsetTbl() { - this.tbl = null; + public void unsetRequest() { + this.request = null; } - /** Returns true if field tbl is set (has been assigned a value) and false otherwise */ - public boolean isSetTbl() { - return this.tbl != null; + /** Returns true if field request is set (has been assigned a value) and false otherwise */ + public boolean isSetRequest() { + return this.request != null; } - public void setTblIsSet(boolean value) { + public void setRequestIsSet(boolean value) { if (!value) { - this.tbl = null; + this.request = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { - case TBL: + case REQUEST: if (value == null) { - unsetTbl(); + unsetRequest(); } else { - setTbl((Table)value); + setRequest((CreateTableRequest)value); } break; @@ -84121,8 +84121,8 @@ package org.apache.hadoop.hive.metastore.api; @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case TBL: - return getTbl(); + case REQUEST: + return getRequest(); } throw new java.lang.IllegalStateException(); @@ -84135,8 +84135,8 @@ package org.apache.hadoop.hive.metastore.api; } switch (field) { - case TBL: - return isSetTbl(); + case REQUEST: + return isSetRequest(); } throw new java.lang.IllegalStateException(); } @@ -84154,12 +84154,12 @@ package org.apache.hadoop.hive.metastore.api; if (this == that) return true; - boolean this_present_tbl = true && this.isSetTbl(); - boolean that_present_tbl = true && that.isSetTbl(); - if (this_present_tbl || that_present_tbl) { - if (!(this_present_tbl && that_present_tbl)) + boolean this_present_request = true && this.isSetRequest(); + boolean that_present_request = true && that.isSetRequest(); + if (this_present_request || that_present_request) { + if (!(this_present_request && that_present_request)) return false; - if (!this.tbl.equals(that.tbl)) + if (!this.request.equals(that.request)) return false; } @@ -84170,9 +84170,9 @@ package org.apache.hadoop.hive.metastore.api; public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetTbl()) ? 131071 : 524287); - if (isSetTbl()) - hashCode = hashCode * 8191 + tbl.hashCode(); + hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287); + if (isSetRequest()) + hashCode = hashCode * 8191 + request.hashCode(); return hashCode; } @@ -84185,12 +84185,12 @@ package org.apache.hadoop.hive.metastore.api; int lastComparison = 0; - lastComparison = java.lang.Boolean.compare(isSetTbl(), other.isSetTbl()); + lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } - if (isSetTbl()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tbl, other.tbl); + if (isSetRequest()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } @@ -84216,11 +84216,11 @@ package org.apache.hadoop.hive.metastore.api; java.lang.StringBuilder sb = new java.lang.StringBuilder("translate_table_dryrun_args("); boolean first = true; - sb.append("tbl:"); - if (this.tbl == null) { + sb.append("request:"); + if (this.request == null) { sb.append("null"); } else { - sb.append(this.tbl); + sb.append(this.request); } first = false; sb.append(")"); @@ -84230,8 +84230,8 @@ package org.apache.hadoop.hive.metastore.api; public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity - if (tbl != null) { - tbl.validate(); + if (request != null) { + request.validate(); } } @@ -84269,11 +84269,11 @@ package org.apache.hadoop.hive.metastore.api; break; } switch (schemeField.id) { - case 1: // TBL + case 1: // REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.tbl = new Table(); - struct.tbl.read(iprot); - struct.setTblIsSet(true); + struct.request = new CreateTableRequest(); + struct.request.read(iprot); + struct.setRequestIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -84291,9 +84291,9 @@ package org.apache.hadoop.hive.metastore.api; struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.tbl != null) { - oprot.writeFieldBegin(TBL_FIELD_DESC); - struct.tbl.write(oprot); + if (struct.request != null) { + oprot.writeFieldBegin(REQUEST_FIELD_DESC); + struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -84314,12 +84314,12 @@ package org.apache.hadoop.hive.metastore.api; public void write(org.apache.thrift.protocol.TProtocol prot, translate_table_dryrun_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetTbl()) { + if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); - if (struct.isSetTbl()) { - struct.tbl.write(oprot); + if (struct.isSetRequest()) { + struct.request.write(oprot); } } @@ -84328,9 +84328,9 @@ package org.apache.hadoop.hive.metastore.api; org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { - struct.tbl = new Table(); - struct.tbl.read(iprot); - struct.setTblIsSet(true); + struct.request = new CreateTableRequest(); + struct.request.read(iprot); + struct.setRequestIsSet(true); } } } diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php index 51000cf..75a45f0 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreClient.php @@ -2623,16 +2623,16 @@ class ThriftHiveMetastoreClient extends \FacebookServiceClient implements \metas return; } - public function translate_table_dryrun(\metastore\Table $tbl) + public function translate_table_dryrun(\metastore\CreateTableRequest $request) { - $this->send_translate_table_dryrun($tbl); + $this->send_translate_table_dryrun($request); return $this->recv_translate_table_dryrun(); } - public function send_translate_table_dryrun(\metastore\Table $tbl) + public function send_translate_table_dryrun(\metastore\CreateTableRequest $request) { $args = new \metastore\ThriftHiveMetastore_translate_table_dryrun_args(); - $args->tbl = $tbl; + $args->request = $request; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { thrift_protocol_write_binary( diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php index 010f896..df1450a 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastoreIf.php @@ -313,14 +313,14 @@ interface ThriftHiveMetastoreIf extends \FacebookServiceIf */ public function add_check_constraint(\metastore\AddCheckConstraintRequest $req); /** - * @param \metastore\Table $tbl + * @param \metastore\CreateTableRequest $request * @return \metastore\Table * @throws \metastore\AlreadyExistsException * @throws \metastore\InvalidObjectException * @throws \metastore\MetaException * @throws \metastore\NoSuchObjectException */ - public function translate_table_dryrun(\metastore\Table $tbl); + public function translate_table_dryrun(\metastore\CreateTableRequest $request); /** * @param string $dbname * @param string $name diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_translate_table_dryrun_args.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_translate_table_dryrun_args.php index c0731d1..688055c 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_translate_table_dryrun_args.php +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore_translate_table_dryrun_args.php @@ -22,23 +22,23 @@ class ThriftHiveMetastore_translate_table_dryrun_args static public $_TSPEC = array( 1 => array( - 'var' => 'tbl', + 'var' => 'request', 'isRequired' => false, 'type' => TType::STRUCT, - 'class' => '\metastore\Table', + 'class' => '\metastore\CreateTableRequest', ), ); /** - * @var \metastore\Table + * @var \metastore\CreateTableRequest */ - public $tbl = null; + public $request = null; public function __construct($vals = null) { if (is_array($vals)) { - if (isset($vals['tbl'])) { - $this->tbl = $vals['tbl']; + if (isset($vals['request'])) { + $this->request = $vals['request']; } } } @@ -64,8 +64,8 @@ class ThriftHiveMetastore_translate_table_dryrun_args switch ($fid) { case 1: if ($ftype == TType::STRUCT) { - $this->tbl = new \metastore\Table(); - $xfer += $this->tbl->read($input); + $this->request = new \metastore\CreateTableRequest(); + $xfer += $this->request->read($input); } else { $xfer += $input->skip($ftype); } @@ -84,12 +84,12 @@ class ThriftHiveMetastore_translate_table_dryrun_args { $xfer = 0; $xfer += $output->writeStructBegin('ThriftHiveMetastore_translate_table_dryrun_args'); - if ($this->tbl !== null) { - if (!is_object($this->tbl)) { + if ($this->request !== null) { + if (!is_object($this->request)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } - $xfer += $output->writeFieldBegin('tbl', TType::STRUCT, 1); - $xfer += $this->tbl->write($output); + $xfer += $output->writeFieldBegin('request', TType::STRUCT, 1); + $xfer += $this->request->write($output); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote index 6893589..beff12d 100755 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote @@ -64,7 +64,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print(' void add_not_null_constraint(AddNotNullConstraintRequest req)') print(' void add_default_constraint(AddDefaultConstraintRequest req)') print(' void add_check_constraint(AddCheckConstraintRequest req)') - print(' Table translate_table_dryrun(Table tbl)') + print(' Table translate_table_dryrun(CreateTableRequest request)') print(' void drop_table(string dbname, string name, bool deleteData)') print(' void drop_table_with_environment_context(string dbname, string name, bool deleteData, EnvironmentContext environment_context)') print(' void truncate_table(string dbName, string tableName, partNames)') diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py index 1a20c9c..34a5ba6 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py @@ -349,10 +349,10 @@ class Iface(fb303.FacebookService.Iface): """ pass - def translate_table_dryrun(self, tbl): + def translate_table_dryrun(self, request): """ Parameters: - - tbl + - request """ pass @@ -3728,19 +3728,19 @@ class Client(fb303.FacebookService.Client, Iface): raise result.o2 return - def translate_table_dryrun(self, tbl): + def translate_table_dryrun(self, request): """ Parameters: - - tbl + - request """ - self.send_translate_table_dryrun(tbl) + self.send_translate_table_dryrun(request) return self.recv_translate_table_dryrun() - def send_translate_table_dryrun(self, tbl): + def send_translate_table_dryrun(self, request): self._oprot.writeMessageBegin('translate_table_dryrun', TMessageType.CALL, self._seqid) args = translate_table_dryrun_args() - args.tbl = tbl + args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() @@ -13407,7 +13407,7 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): iprot.readMessageEnd() result = translate_table_dryrun_result() try: - result.success = self._handler.translate_table_dryrun(args.tbl) + result.success = self._handler.translate_table_dryrun(args.request) msg_type = TMessageType.REPLY except TTransport.TTransportException: raise @@ -25945,13 +25945,13 @@ add_check_constraint_result.thrift_spec = ( class translate_table_dryrun_args(object): """ Attributes: - - tbl + - request """ - def __init__(self, tbl=None,): - self.tbl = tbl + def __init__(self, request=None,): + self.request = request def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -25964,8 +25964,8 @@ class translate_table_dryrun_args(object): break if fid == 1: if ftype == TType.STRUCT: - self.tbl = Table() - self.tbl.read(iprot) + self.request = CreateTableRequest() + self.request.read(iprot) else: iprot.skip(ftype) else: @@ -25978,9 +25978,9 @@ class translate_table_dryrun_args(object): oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('translate_table_dryrun_args') - if self.tbl is not None: - oprot.writeFieldBegin('tbl', TType.STRUCT, 1) - self.tbl.write(oprot) + if self.request is not None: + oprot.writeFieldBegin('request', TType.STRUCT, 1) + self.request.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -26001,7 +26001,7 @@ class translate_table_dryrun_args(object): all_structs.append(translate_table_dryrun_args) translate_table_dryrun_args.thrift_spec = ( None, # 0 - (1, TType.STRUCT, 'tbl', [Table, None], None, ), # 1 + (1, TType.STRUCT, 'request', [CreateTableRequest, None], None, ), # 1 ) diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb b/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb index f069562..d5b1fac 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-rb/thrift_hive_metastore.rb @@ -686,13 +686,13 @@ module ThriftHiveMetastore return end - def translate_table_dryrun(tbl) - send_translate_table_dryrun(tbl) + def translate_table_dryrun(request) + send_translate_table_dryrun(request) return recv_translate_table_dryrun() end - def send_translate_table_dryrun(tbl) - send_message('translate_table_dryrun', Translate_table_dryrun_args, :tbl => tbl) + def send_translate_table_dryrun(request) + send_message('translate_table_dryrun', Translate_table_dryrun_args, :request => request) end def recv_translate_table_dryrun() @@ -4975,7 +4975,7 @@ module ThriftHiveMetastore args = read_args(iprot, Translate_table_dryrun_args) result = Translate_table_dryrun_result.new() begin - result.success = @handler.translate_table_dryrun(args.tbl) + result.success = @handler.translate_table_dryrun(args.request) rescue ::AlreadyExistsException => o1 result.o1 = o1 rescue ::InvalidObjectException => o2 @@ -9188,10 +9188,10 @@ module ThriftHiveMetastore class Translate_table_dryrun_args include ::Thrift::Struct, ::Thrift::Struct_Union - TBL = 1 + REQUEST = 1 FIELDS = { - TBL => {:type => ::Thrift::Types::STRUCT, :name => 'tbl', :class => ::Table} + REQUEST => {:type => ::Thrift::Types::STRUCT, :name => 'request', :class => ::CreateTableRequest} } def struct_fields; FIELDS; end diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index e72b84f..7d67315 100644 --- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -1229,7 +1229,13 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { @Override public Table getTranslateTableDryrun(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { - return client.translate_table_dryrun(tbl); + CreateTableRequest request = new CreateTableRequest(tbl); + + if (processorCapabilities != null) { + request.setProcessorCapabilities(new ArrayList<String>(Arrays.asList(processorCapabilities))); + request.setProcessorIdentifier(processorIdentifier); + } + return client.translate_table_dryrun(request); } /** diff --git a/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift b/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift index f61be6d..fa5cd19 100644 --- a/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift +++ b/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift @@ -2444,7 +2444,8 @@ service ThriftHiveMetastore extends fb303.FacebookService throws(1:NoSuchObjectException o1, 2:MetaException o2) void add_check_constraint(1:AddCheckConstraintRequest req) throws(1:NoSuchObjectException o1, 2:MetaException o2) - Table translate_table_dryrun(1:Table tbl) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4) + Table translate_table_dryrun(1:CreateTableRequest request) + 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) diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java index 7f083de..fab149c 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java @@ -2241,14 +2241,17 @@ public class HMSHandler extends FacebookBase implements IHMSHandler { } @Override - public Table translate_table_dryrun(final Table tbl) throws AlreadyExistsException, + public Table translate_table_dryrun(final CreateTableRequest req) throws AlreadyExistsException, MetaException, InvalidObjectException, InvalidInputException { Table transformedTbl = null; + Table tbl = req.getTable(); + List<String> processorCapabilities = req.getProcessorCapabilities(); + String processorId = req.getProcessorIdentifier(); if (!tbl.isSetCatName()) { tbl.setCatName(getDefaultCatalog(conf)); } if (transformer != null) { - transformedTbl = transformer.transformCreateTable(tbl, null, null); + transformedTbl = transformer.transformCreateTable(tbl, processorCapabilities, processorId); } return transformedTbl != null ? transformedTbl : tbl; } diff --git a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java index e8b0881..db141c4 100644 --- a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java +++ b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientPreCatalog.java @@ -795,7 +795,8 @@ public class HiveMetaStoreClientPreCatalog implements IMetaStoreClient, AutoClos @Override public Table getTranslateTableDryrun(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { - return client.translate_table_dryrun(tbl); + CreateTableRequest request = new CreateTableRequest(tbl); + return client.translate_table_dryrun(request); } /**