From c6205aa15c76455d67a7c073bf8ffa14f987e063 Mon Sep 17 00:00:00 2001 From: Vihang Karajgaonkar Date: Fri, 24 Aug 2018 16:13:57 -0700 Subject: [PATCH] HIVE-20365 : Fix warnings when regenerating thrift code --- .../hadoop/hive/metastore/api/ThriftHiveMetastore.java | 18 +++++++++--------- .../thrift/gen-php/metastore/ThriftHiveMetastore.php | 14 +++++++------- .../gen-py/hive_metastore/ThriftHiveMetastore.py | 18 ++++++++++++------ .../src/gen/thrift/gen-rb/thrift_hive_metastore.rb | 2 +- .../src/main/thrift/hive_metastore.thrift | 2 +- 5 files changed, 30 insertions(+), 24 deletions(-) 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 47f96f3..ae09568 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 @@ -230374,7 +230374,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, create_ischema_args private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("create_ischema_result"); private static final org.apache.thrift.protocol.TField O1_FIELD_DESC = new org.apache.thrift.protocol.TField("o1", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)-1); + private static final org.apache.thrift.protocol.TField O2_FIELD_DESC = new org.apache.thrift.protocol.TField("o2", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField O3_FIELD_DESC = new org.apache.thrift.protocol.TField("o3", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); @@ -230390,7 +230390,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, create_ischema_args /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { O1((short)1, "o1"), - O2((short)-1, "o2"), + O2((short)2, "o2"), O3((short)3, "o3"); private static final Map byName = new HashMap(); @@ -230408,7 +230408,7 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // O1 return O1; - case -1: // O2 + case 2: // O2 return O2; case 3: // O3 return O3; @@ -230833,7 +230833,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, create_ischema_resu org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -1: // O2 + case 2: // O2 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.o2 = new NoSuchObjectException(); struct.o2.read(iprot); @@ -230864,16 +230864,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, create_ischema_res struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.o2 != null) { - oprot.writeFieldBegin(O2_FIELD_DESC); - struct.o2.write(oprot); - oprot.writeFieldEnd(); - } if (struct.o1 != null) { oprot.writeFieldBegin(O1_FIELD_DESC); struct.o1.write(oprot); oprot.writeFieldEnd(); } + if (struct.o2 != null) { + oprot.writeFieldBegin(O2_FIELD_DESC); + struct.o2.write(oprot); + oprot.writeFieldEnd(); + } if (struct.o3 != null) { oprot.writeFieldBegin(O3_FIELD_DESC); struct.o3.write(oprot); diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php index 0973f4f..4574c6a 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php @@ -58155,7 +58155,7 @@ class ThriftHiveMetastore_create_ischema_result { 'type' => TType::STRUCT, 'class' => '\metastore\AlreadyExistsException', ), - -1 => array( + 2 => array( 'var' => 'o2', 'type' => TType::STRUCT, 'class' => '\metastore\NoSuchObjectException', @@ -58207,7 +58207,7 @@ class ThriftHiveMetastore_create_ischema_result { $xfer += $input->skip($ftype); } break; - case -1: + case 2: if ($ftype == TType::STRUCT) { $this->o2 = new \metastore\NoSuchObjectException(); $xfer += $this->o2->read($input); @@ -58236,16 +58236,16 @@ class ThriftHiveMetastore_create_ischema_result { public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('ThriftHiveMetastore_create_ischema_result'); - if ($this->o2 !== null) { - $xfer += $output->writeFieldBegin('o2', TType::STRUCT, -1); - $xfer += $this->o2->write($output); - $xfer += $output->writeFieldEnd(); - } if ($this->o1 !== null) { $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); $xfer += $this->o1->write($output); $xfer += $output->writeFieldEnd(); } + if ($this->o2 !== null) { + $xfer += $output->writeFieldBegin('o2', TType::STRUCT, 2); + $xfer += $this->o2->write($output); + $xfer += $output->writeFieldEnd(); + } if ($this->o3 !== null) { $xfer += $output->writeFieldBegin('o3', TType::STRUCT, 3); $xfer += $this->o3->write($output); 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 3c0d0a5..38074ce 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 @@ -47673,7 +47673,13 @@ class create_ischema_result: - o3 """ - thrift_spec = None + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'o1', (AlreadyExistsException, AlreadyExistsException.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'o2', (NoSuchObjectException, NoSuchObjectException.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'o3', (MetaException, MetaException.thrift_spec), None, ), # 3 + ) + def __init__(self, o1=None, o2=None, o3=None,): self.o1 = o1 self.o2 = o2 @@ -47694,7 +47700,7 @@ def read(self, iprot): self.o1.read(iprot) else: iprot.skip(ftype) - elif fid == -1: + elif fid == 2: if ftype == TType.STRUCT: self.o2 = NoSuchObjectException() self.o2.read(iprot) @@ -47716,14 +47722,14 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('create_ischema_result') - if self.o2 is not None: - oprot.writeFieldBegin('o2', TType.STRUCT, -1) - self.o2.write(oprot) - oprot.writeFieldEnd() if self.o1 is not None: oprot.writeFieldBegin('o1', TType.STRUCT, 1) self.o1.write(oprot) oprot.writeFieldEnd() + if self.o2 is not None: + oprot.writeFieldBegin('o2', TType.STRUCT, 2) + self.o2.write(oprot) + oprot.writeFieldEnd() if self.o3 is not None: oprot.writeFieldBegin('o3', TType.STRUCT, 3) self.o3.write(oprot) 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 e54a732..e6a7276 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 @@ -13573,7 +13573,7 @@ module ThriftHiveMetastore class Create_ischema_result include ::Thrift::Struct, ::Thrift::Struct_Union O1 = 1 - O2 = -1 + O2 = 2 O3 = 3 FIELDS = { 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 feb44d5..bcc8ebf 100644 --- a/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift +++ b/standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift @@ -2289,7 +2289,7 @@ service ThriftHiveMetastore extends fb303.FacebookService // Schema calls void create_ischema(1:ISchema schema) throws(1:AlreadyExistsException o1, - NoSuchObjectException o2, 3:MetaException o3) + 2:NoSuchObjectException o2, 3:MetaException o3) void alter_ischema(1:AlterISchemaRequest rqst) throws(1:NoSuchObjectException o1, 2:MetaException o2) ISchema get_ischema(1:ISchemaName name) throws (1:NoSuchObjectException o1, 2:MetaException o2) -- 2.7.4 (Apple Git-66)