diff --git jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java index 4cda742..359a580 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java @@ -44,6 +44,7 @@ import org.apache.hive.service.cli.TableSchema; import org.apache.hive.service.cli.Type; +import org.apache.hive.service.cli.thrift.TBinaryValue; import org.apache.hive.service.cli.thrift.TBoolValue; import org.apache.hive.service.cli.thrift.TByteValue; import org.apache.hive.service.cli.thrift.TColumnValue; @@ -460,10 +461,10 @@ private Timestamp getTimestampValue(TStringValue tStringValue) { return null; } - private byte[] getBinaryValue(TStringValue tString) { - if (tString.isSetValue()) { + private byte[] getBinaryValue(TBinaryValue tBinary) { + if (tBinary.isSetValue()) { wasNull = false; - return tString.getValue().getBytes(); + return tBinary.getValue(); } wasNull = true; return null; @@ -513,7 +514,7 @@ private Object getColumnValue(int columnIndex) throws SQLException { case VARCHAR_TYPE: return getStringValue(tColumnValue.getStringVal()); case BINARY_TYPE: - return getBinaryValue(tColumnValue.getStringVal()); + return getBinaryValue(tColumnValue.getBinaryVal()); case DATE_TYPE: return getDateValue(tColumnValue.getStringVal()); case TIMESTAMP_TYPE: diff --git metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote old mode 100644 new mode 100755 diff --git serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/test/ThriftTestObj.java serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/test/ThriftTestObj.java index dda3c5f..1b708dd 100644 --- serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/test/ThriftTestObj.java +++ serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde/test/ThriftTestObj.java @@ -528,7 +528,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftTestObj struc struct.field3 = new ArrayList(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { - InnerStruct _elem2; // optional + InnerStruct _elem2; // required _elem2 = new InnerStruct(); _elem2.read(iprot); struct.field3.add(_elem2); @@ -636,7 +636,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ThriftTestObj struct struct.field3 = new ArrayList(_list5.size); for (int _i6 = 0; _i6 < _list5.size; ++_i6) { - InnerStruct _elem7; // optional + InnerStruct _elem7; // required _elem7 = new InnerStruct(); _elem7.read(iprot); struct.field3.add(_elem7); diff --git serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/Complex.java serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/Complex.java index aa404bf..e36a792 100644 --- serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/Complex.java +++ serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/Complex.java @@ -836,7 +836,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, Complex struct) thr struct.lint = new ArrayList(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { - int _elem2; // optional + int _elem2; // required _elem2 = iprot.readI32(); struct.lint.add(_elem2); } @@ -854,7 +854,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, Complex struct) thr struct.lString = new ArrayList(_list3.size); for (int _i4 = 0; _i4 < _list3.size; ++_i4) { - String _elem5; // optional + String _elem5; // required _elem5 = iprot.readString(); struct.lString.add(_elem5); } @@ -872,7 +872,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, Complex struct) thr struct.lintString = new ArrayList(_list6.size); for (int _i7 = 0; _i7 < _list6.size; ++_i7) { - IntString _elem8; // optional + IntString _elem8; // required _elem8 = new IntString(); _elem8.read(iprot); struct.lintString.add(_elem8); @@ -1074,7 +1074,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, Complex struct) thro struct.lint = new ArrayList(_list21.size); for (int _i22 = 0; _i22 < _list21.size; ++_i22) { - int _elem23; // optional + int _elem23; // required _elem23 = iprot.readI32(); struct.lint.add(_elem23); } @@ -1087,7 +1087,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, Complex struct) thro struct.lString = new ArrayList(_list24.size); for (int _i25 = 0; _i25 < _list24.size; ++_i25) { - String _elem26; // optional + String _elem26; // required _elem26 = iprot.readString(); struct.lString.add(_elem26); } @@ -1100,7 +1100,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, Complex struct) thro struct.lintString = new ArrayList(_list27.size); for (int _i28 = 0; _i28 < _list27.size; ++_i28) { - IntString _elem29; // optional + IntString _elem29; // required _elem29 = new IntString(); _elem29.read(iprot); struct.lintString.add(_elem29); diff --git serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MegaStruct.java serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MegaStruct.java index fba49e4..386fef9 100644 --- serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MegaStruct.java +++ serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MegaStruct.java @@ -2280,7 +2280,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) _val19 = new ArrayList(_list20.size); for (int _i21 = 0; _i21 < _list20.size; ++_i21) { - String _elem22; // optional + String _elem22; // required _elem22 = iprot.readString(); _val19.add(_elem22); } @@ -2310,7 +2310,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) _val26 = new ArrayList(_list27.size); for (int _i28 = 0; _i28 < _list27.size; ++_i28) { - MiniStruct _elem29; // optional + MiniStruct _elem29; // required _elem29 = new MiniStruct(); _elem29.read(iprot); _val26.add(_elem29); @@ -2333,7 +2333,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) struct.my_stringlist = new ArrayList(_list30.size); for (int _i31 = 0; _i31 < _list30.size; ++_i31) { - String _elem32; // optional + String _elem32; // required _elem32 = iprot.readString(); struct.my_stringlist.add(_elem32); } @@ -2351,7 +2351,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) struct.my_structlist = new ArrayList(_list33.size); for (int _i34 = 0; _i34 < _list33.size; ++_i34) { - MiniStruct _elem35; // optional + MiniStruct _elem35; // required _elem35 = new MiniStruct(); _elem35.read(iprot); struct.my_structlist.add(_elem35); @@ -2370,7 +2370,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) struct.my_enumlist = new ArrayList(_list36.size); for (int _i37 = 0; _i37 < _list36.size; ++_i37) { - MyEnum _elem38; // optional + MyEnum _elem38; // required _elem38 = MyEnum.findByValue(iprot.readI32()); struct.my_enumlist.add(_elem38); } @@ -2388,7 +2388,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) struct.my_stringset = new HashSet(2*_set39.size); for (int _i40 = 0; _i40 < _set39.size; ++_i40) { - String _elem41; // optional + String _elem41; // required _elem41 = iprot.readString(); struct.my_stringset.add(_elem41); } @@ -2406,7 +2406,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) struct.my_enumset = new HashSet(2*_set42.size); for (int _i43 = 0; _i43 < _set42.size; ++_i43) { - MyEnum _elem44; // optional + MyEnum _elem44; // required _elem44 = MyEnum.findByValue(iprot.readI32()); struct.my_enumset.add(_elem44); } @@ -2424,7 +2424,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, MegaStruct struct) struct.my_structset = new HashSet(2*_set45.size); for (int _i46 = 0; _i46 < _set45.size; ++_i46) { - MiniStruct _elem47; // optional + MiniStruct _elem47; // required _elem47 = new MiniStruct(); _elem47.read(iprot); struct.my_structset.add(_elem47); @@ -3023,7 +3023,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t _val95 = new ArrayList(_list96.size); for (int _i97 = 0; _i97 < _list96.size; ++_i97) { - String _elem98; // optional + String _elem98; // required _elem98 = iprot.readString(); _val95.add(_elem98); } @@ -3047,7 +3047,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t _val102 = new ArrayList(_list103.size); for (int _i104 = 0; _i104 < _list103.size; ++_i104) { - MiniStruct _elem105; // optional + MiniStruct _elem105; // required _elem105 = new MiniStruct(); _elem105.read(iprot); _val102.add(_elem105); @@ -3064,7 +3064,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t struct.my_stringlist = new ArrayList(_list106.size); for (int _i107 = 0; _i107 < _list106.size; ++_i107) { - String _elem108; // optional + String _elem108; // required _elem108 = iprot.readString(); struct.my_stringlist.add(_elem108); } @@ -3077,7 +3077,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t struct.my_structlist = new ArrayList(_list109.size); for (int _i110 = 0; _i110 < _list109.size; ++_i110) { - MiniStruct _elem111; // optional + MiniStruct _elem111; // required _elem111 = new MiniStruct(); _elem111.read(iprot); struct.my_structlist.add(_elem111); @@ -3091,7 +3091,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t struct.my_enumlist = new ArrayList(_list112.size); for (int _i113 = 0; _i113 < _list112.size; ++_i113) { - MyEnum _elem114; // optional + MyEnum _elem114; // required _elem114 = MyEnum.findByValue(iprot.readI32()); struct.my_enumlist.add(_elem114); } @@ -3104,7 +3104,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t struct.my_stringset = new HashSet(2*_set115.size); for (int _i116 = 0; _i116 < _set115.size; ++_i116) { - String _elem117; // optional + String _elem117; // required _elem117 = iprot.readString(); struct.my_stringset.add(_elem117); } @@ -3117,7 +3117,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t struct.my_enumset = new HashSet(2*_set118.size); for (int _i119 = 0; _i119 < _set118.size; ++_i119) { - MyEnum _elem120; // optional + MyEnum _elem120; // required _elem120 = MyEnum.findByValue(iprot.readI32()); struct.my_enumset.add(_elem120); } @@ -3130,7 +3130,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, MegaStruct struct) t struct.my_structset = new HashSet(2*_set121.size); for (int _i122 = 0; _i122 < _set121.size; ++_i122) { - MiniStruct _elem123; // optional + MiniStruct _elem123; // required _elem123 = new MiniStruct(); _elem123.read(iprot); struct.my_structset.add(_elem123); diff --git service/if/TCLIService.thrift service/if/TCLIService.thrift index 6e20375..3f365ba 100644 --- service/if/TCLIService.thrift +++ service/if/TCLIService.thrift @@ -291,6 +291,11 @@ struct TStringValue { 1: optional string value } +struct TBinaryValue { + // NULL if value is unset + 1: optional binary value +} + union TColumn { 1: list boolColumn 2: list byteColumn @@ -299,6 +304,7 @@ union TColumn { 5: list i64Column 6: list doubleColumn 7: list stringColumn + 8: list binaryColumn } // A single column value in a result set. @@ -314,7 +320,8 @@ union TColumnValue { 4: TI32Value i32Val // INT 5: TI64Value i64Val // BIGINT, TIMESTAMP 6: TDoubleValue doubleVal // FLOAT, DOUBLE - 7: TStringValue stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, BINARY, DECIMAL, NULL + 7: TStringValue stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, DECIMAL, NULL + 8: TBinaryValue binaryVal // BINARY } // Represents a row in a rowset. diff --git service/src/gen/thrift/gen-cpp/TCLIService_types.cpp service/src/gen/thrift/gen-cpp/TCLIService_types.cpp index a3fd46c..4f7a9a6 100644 --- service/src/gen/thrift/gen-cpp/TCLIService_types.cpp +++ service/src/gen/thrift/gen-cpp/TCLIService_types.cpp @@ -1723,8 +1723,71 @@ void swap(TStringValue &a, TStringValue &b) { swap(a.__isset, b.__isset); } -const char* TColumn::ascii_fingerprint = "B39B4E4E565DB31DC891D62FDC3208DC"; -const uint8_t TColumn::binary_fingerprint[16] = {0xB3,0x9B,0x4E,0x4E,0x56,0x5D,0xB3,0x1D,0xC8,0x91,0xD6,0x2F,0xDC,0x32,0x08,0xDC}; +const char* TBinaryValue::ascii_fingerprint = "66E694018C17E5B65A59AE8F55CCA3CD"; +const uint8_t TBinaryValue::binary_fingerprint[16] = {0x66,0xE6,0x94,0x01,0x8C,0x17,0xE5,0xB6,0x5A,0x59,0xAE,0x8F,0x55,0xCC,0xA3,0xCD}; + +uint32_t TBinaryValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TBinaryValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TBinaryValue"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TBinaryValue &a, TBinaryValue &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +const char* TColumn::ascii_fingerprint = "6A1A7F0836F31986E3212216A1D53D06"; +const uint8_t TColumn::binary_fingerprint[16] = {0x6A,0x1A,0x7F,0x08,0x36,0xF3,0x19,0x86,0xE3,0x21,0x22,0x16,0xA1,0xD5,0x3D,0x06}; uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1886,6 +1949,26 @@ uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->binaryColumn.clear(); + uint32_t _size72; + ::apache::thrift::protocol::TType _etype75; + xfer += iprot->readListBegin(_etype75, _size72); + this->binaryColumn.resize(_size72); + uint32_t _i76; + for (_i76 = 0; _i76 < _size72; ++_i76) + { + xfer += this->binaryColumn[_i76].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.binaryColumn = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -1905,10 +1988,10 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("boolColumn", ::apache::thrift::protocol::T_LIST, 1); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->boolColumn.size())); - std::vector ::const_iterator _iter72; - for (_iter72 = this->boolColumn.begin(); _iter72 != this->boolColumn.end(); ++_iter72) + std::vector ::const_iterator _iter77; + for (_iter77 = this->boolColumn.begin(); _iter77 != this->boolColumn.end(); ++_iter77) { - xfer += (*_iter72).write(oprot); + xfer += (*_iter77).write(oprot); } xfer += oprot->writeListEnd(); } @@ -1917,10 +2000,10 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("byteColumn", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->byteColumn.size())); - std::vector ::const_iterator _iter73; - for (_iter73 = this->byteColumn.begin(); _iter73 != this->byteColumn.end(); ++_iter73) + std::vector ::const_iterator _iter78; + for (_iter78 = this->byteColumn.begin(); _iter78 != this->byteColumn.end(); ++_iter78) { - xfer += (*_iter73).write(oprot); + xfer += (*_iter78).write(oprot); } xfer += oprot->writeListEnd(); } @@ -1929,10 +2012,10 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("i16Column", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->i16Column.size())); - std::vector ::const_iterator _iter74; - for (_iter74 = this->i16Column.begin(); _iter74 != this->i16Column.end(); ++_iter74) + std::vector ::const_iterator _iter79; + for (_iter79 = this->i16Column.begin(); _iter79 != this->i16Column.end(); ++_iter79) { - xfer += (*_iter74).write(oprot); + xfer += (*_iter79).write(oprot); } xfer += oprot->writeListEnd(); } @@ -1941,10 +2024,10 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("i32Column", ::apache::thrift::protocol::T_LIST, 4); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->i32Column.size())); - std::vector ::const_iterator _iter75; - for (_iter75 = this->i32Column.begin(); _iter75 != this->i32Column.end(); ++_iter75) + std::vector ::const_iterator _iter80; + for (_iter80 = this->i32Column.begin(); _iter80 != this->i32Column.end(); ++_iter80) { - xfer += (*_iter75).write(oprot); + xfer += (*_iter80).write(oprot); } xfer += oprot->writeListEnd(); } @@ -1953,10 +2036,10 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("i64Column", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->i64Column.size())); - std::vector ::const_iterator _iter76; - for (_iter76 = this->i64Column.begin(); _iter76 != this->i64Column.end(); ++_iter76) + std::vector ::const_iterator _iter81; + for (_iter81 = this->i64Column.begin(); _iter81 != this->i64Column.end(); ++_iter81) { - xfer += (*_iter76).write(oprot); + xfer += (*_iter81).write(oprot); } xfer += oprot->writeListEnd(); } @@ -1965,10 +2048,10 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("doubleColumn", ::apache::thrift::protocol::T_LIST, 6); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->doubleColumn.size())); - std::vector ::const_iterator _iter77; - for (_iter77 = this->doubleColumn.begin(); _iter77 != this->doubleColumn.end(); ++_iter77) + std::vector ::const_iterator _iter82; + for (_iter82 = this->doubleColumn.begin(); _iter82 != this->doubleColumn.end(); ++_iter82) { - xfer += (*_iter77).write(oprot); + xfer += (*_iter82).write(oprot); } xfer += oprot->writeListEnd(); } @@ -1977,10 +2060,22 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("stringColumn", ::apache::thrift::protocol::T_LIST, 7); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->stringColumn.size())); - std::vector ::const_iterator _iter78; - for (_iter78 = this->stringColumn.begin(); _iter78 != this->stringColumn.end(); ++_iter78) + std::vector ::const_iterator _iter83; + for (_iter83 = this->stringColumn.begin(); _iter83 != this->stringColumn.end(); ++_iter83) { - xfer += (*_iter78).write(oprot); + xfer += (*_iter83).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("binaryColumn", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->binaryColumn.size())); + std::vector ::const_iterator _iter84; + for (_iter84 = this->binaryColumn.begin(); _iter84 != this->binaryColumn.end(); ++_iter84) + { + xfer += (*_iter84).write(oprot); } xfer += oprot->writeListEnd(); } @@ -2000,11 +2095,12 @@ void swap(TColumn &a, TColumn &b) { swap(a.i64Column, b.i64Column); swap(a.doubleColumn, b.doubleColumn); swap(a.stringColumn, b.stringColumn); + swap(a.binaryColumn, b.binaryColumn); swap(a.__isset, b.__isset); } -const char* TColumnValue::ascii_fingerprint = "C2DDD988447EA7999A8285AA38AAE9AD"; -const uint8_t TColumnValue::binary_fingerprint[16] = {0xC2,0xDD,0xD9,0x88,0x44,0x7E,0xA7,0x99,0x9A,0x82,0x85,0xAA,0x38,0xAA,0xE9,0xAD}; +const char* TColumnValue::ascii_fingerprint = "732FCA3EB6DEA77690296E3F386F8467"; +const uint8_t TColumnValue::binary_fingerprint[16] = {0x73,0x2F,0xCA,0x3E,0xB6,0xDE,0xA7,0x76,0x90,0x29,0x6E,0x3F,0x38,0x6F,0x84,0x67}; uint32_t TColumnValue::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -2082,6 +2178,14 @@ uint32_t TColumnValue::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->skip(ftype); } break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->binaryVal.read(iprot); + this->__isset.binaryVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -2126,6 +2230,10 @@ uint32_t TColumnValue::write(::apache::thrift::protocol::TProtocol* oprot) const xfer += this->stringVal.write(oprot); xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("binaryVal", ::apache::thrift::protocol::T_STRUCT, 8); + xfer += this->binaryVal.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -2140,11 +2248,12 @@ void swap(TColumnValue &a, TColumnValue &b) { swap(a.i64Val, b.i64Val); swap(a.doubleVal, b.doubleVal); swap(a.stringVal, b.stringVal); + swap(a.binaryVal, b.binaryVal); swap(a.__isset, b.__isset); } -const char* TRow::ascii_fingerprint = "E73FD1FCA0CA58A669FC3E02FB68D534"; -const uint8_t TRow::binary_fingerprint[16] = {0xE7,0x3F,0xD1,0xFC,0xA0,0xCA,0x58,0xA6,0x69,0xFC,0x3E,0x02,0xFB,0x68,0xD5,0x34}; +const char* TRow::ascii_fingerprint = "99AF3D0597DDA00BF09BB2A98402239F"; +const uint8_t TRow::binary_fingerprint[16] = {0x99,0xAF,0x3D,0x05,0x97,0xDD,0xA0,0x0B,0xF0,0x9B,0xB2,0xA9,0x84,0x02,0x23,0x9F}; uint32_t TRow::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -2171,14 +2280,14 @@ uint32_t TRow::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->colVals.clear(); - uint32_t _size79; - ::apache::thrift::protocol::TType _etype82; - xfer += iprot->readListBegin(_etype82, _size79); - this->colVals.resize(_size79); - uint32_t _i83; - for (_i83 = 0; _i83 < _size79; ++_i83) + uint32_t _size85; + ::apache::thrift::protocol::TType _etype88; + xfer += iprot->readListBegin(_etype88, _size85); + this->colVals.resize(_size85); + uint32_t _i89; + for (_i89 = 0; _i89 < _size85; ++_i89) { - xfer += this->colVals[_i83].read(iprot); + xfer += this->colVals[_i89].read(iprot); } xfer += iprot->readListEnd(); } @@ -2208,10 +2317,10 @@ uint32_t TRow::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("colVals", ::apache::thrift::protocol::T_LIST, 1); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->colVals.size())); - std::vector ::const_iterator _iter84; - for (_iter84 = this->colVals.begin(); _iter84 != this->colVals.end(); ++_iter84) + std::vector ::const_iterator _iter90; + for (_iter90 = this->colVals.begin(); _iter90 != this->colVals.end(); ++_iter90) { - xfer += (*_iter84).write(oprot); + xfer += (*_iter90).write(oprot); } xfer += oprot->writeListEnd(); } @@ -2227,8 +2336,8 @@ void swap(TRow &a, TRow &b) { swap(a.colVals, b.colVals); } -const char* TRowSet::ascii_fingerprint = "698727A24268879440EE0DAFE68FC1C5"; -const uint8_t TRowSet::binary_fingerprint[16] = {0x69,0x87,0x27,0xA2,0x42,0x68,0x87,0x94,0x40,0xEE,0x0D,0xAF,0xE6,0x8F,0xC1,0xC5}; +const char* TRowSet::ascii_fingerprint = "AE2923283250406F5034170469433DDB"; +const uint8_t TRowSet::binary_fingerprint[16] = {0xAE,0x29,0x23,0x28,0x32,0x50,0x40,0x6F,0x50,0x34,0x17,0x04,0x69,0x43,0x3D,0xDB}; uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -2264,14 +2373,14 @@ uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->rows.clear(); - uint32_t _size85; - ::apache::thrift::protocol::TType _etype88; - xfer += iprot->readListBegin(_etype88, _size85); - this->rows.resize(_size85); - uint32_t _i89; - for (_i89 = 0; _i89 < _size85; ++_i89) + uint32_t _size91; + ::apache::thrift::protocol::TType _etype94; + xfer += iprot->readListBegin(_etype94, _size91); + this->rows.resize(_size91); + uint32_t _i95; + for (_i95 = 0; _i95 < _size91; ++_i95) { - xfer += this->rows[_i89].read(iprot); + xfer += this->rows[_i95].read(iprot); } xfer += iprot->readListEnd(); } @@ -2284,14 +2393,14 @@ uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->columns.clear(); - uint32_t _size90; - ::apache::thrift::protocol::TType _etype93; - xfer += iprot->readListBegin(_etype93, _size90); - this->columns.resize(_size90); - uint32_t _i94; - for (_i94 = 0; _i94 < _size90; ++_i94) + uint32_t _size96; + ::apache::thrift::protocol::TType _etype99; + xfer += iprot->readListBegin(_etype99, _size96); + this->columns.resize(_size96); + uint32_t _i100; + for (_i100 = 0; _i100 < _size96; ++_i100) { - xfer += this->columns[_i94].read(iprot); + xfer += this->columns[_i100].read(iprot); } xfer += iprot->readListEnd(); } @@ -2327,10 +2436,10 @@ uint32_t TRowSet::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->rows.size())); - std::vector ::const_iterator _iter95; - for (_iter95 = this->rows.begin(); _iter95 != this->rows.end(); ++_iter95) + std::vector ::const_iterator _iter101; + for (_iter101 = this->rows.begin(); _iter101 != this->rows.end(); ++_iter101) { - xfer += (*_iter95).write(oprot); + xfer += (*_iter101).write(oprot); } xfer += oprot->writeListEnd(); } @@ -2340,10 +2449,10 @@ uint32_t TRowSet::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 3); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->columns.size())); - std::vector ::const_iterator _iter96; - for (_iter96 = this->columns.begin(); _iter96 != this->columns.end(); ++_iter96) + std::vector ::const_iterator _iter102; + for (_iter102 = this->columns.begin(); _iter102 != this->columns.end(); ++_iter102) { - xfer += (*_iter96).write(oprot); + xfer += (*_iter102).write(oprot); } xfer += oprot->writeListEnd(); } @@ -2388,9 +2497,9 @@ uint32_t TStatus::read(::apache::thrift::protocol::TProtocol* iprot) { { case 1: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast97; - xfer += iprot->readI32(ecast97); - this->statusCode = (TStatusCode::type)ecast97; + int32_t ecast103; + xfer += iprot->readI32(ecast103); + this->statusCode = (TStatusCode::type)ecast103; isset_statusCode = true; } else { xfer += iprot->skip(ftype); @@ -2400,14 +2509,14 @@ uint32_t TStatus::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->infoMessages.clear(); - uint32_t _size98; - ::apache::thrift::protocol::TType _etype101; - xfer += iprot->readListBegin(_etype101, _size98); - this->infoMessages.resize(_size98); - uint32_t _i102; - for (_i102 = 0; _i102 < _size98; ++_i102) + uint32_t _size104; + ::apache::thrift::protocol::TType _etype107; + xfer += iprot->readListBegin(_etype107, _size104); + this->infoMessages.resize(_size104); + uint32_t _i108; + for (_i108 = 0; _i108 < _size104; ++_i108) { - xfer += iprot->readString(this->infoMessages[_i102]); + xfer += iprot->readString(this->infoMessages[_i108]); } xfer += iprot->readListEnd(); } @@ -2466,10 +2575,10 @@ uint32_t TStatus::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeFieldBegin("infoMessages", ::apache::thrift::protocol::T_LIST, 2); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->infoMessages.size())); - std::vector ::const_iterator _iter103; - for (_iter103 = this->infoMessages.begin(); _iter103 != this->infoMessages.end(); ++_iter103) + std::vector ::const_iterator _iter109; + for (_iter109 = this->infoMessages.begin(); _iter109 != this->infoMessages.end(); ++_iter109) { - xfer += oprot->writeString((*_iter103)); + xfer += oprot->writeString((*_iter109)); } xfer += oprot->writeListEnd(); } @@ -2685,9 +2794,9 @@ uint32_t TOperationHandle::read(::apache::thrift::protocol::TProtocol* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast104; - xfer += iprot->readI32(ecast104); - this->operationType = (TOperationType::type)ecast104; + int32_t ecast110; + xfer += iprot->readI32(ecast110); + this->operationType = (TOperationType::type)ecast110; isset_operationType = true; } else { xfer += iprot->skip(ftype); @@ -2788,9 +2897,9 @@ uint32_t TOpenSessionReq::read(::apache::thrift::protocol::TProtocol* iprot) { { case 1: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast105; - xfer += iprot->readI32(ecast105); - this->client_protocol = (TProtocolVersion::type)ecast105; + int32_t ecast111; + xfer += iprot->readI32(ecast111); + this->client_protocol = (TProtocolVersion::type)ecast111; isset_client_protocol = true; } else { xfer += iprot->skip(ftype); @@ -2816,17 +2925,17 @@ uint32_t TOpenSessionReq::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_MAP) { { this->configuration.clear(); - uint32_t _size106; - ::apache::thrift::protocol::TType _ktype107; - ::apache::thrift::protocol::TType _vtype108; - xfer += iprot->readMapBegin(_ktype107, _vtype108, _size106); - uint32_t _i110; - for (_i110 = 0; _i110 < _size106; ++_i110) + uint32_t _size112; + ::apache::thrift::protocol::TType _ktype113; + ::apache::thrift::protocol::TType _vtype114; + xfer += iprot->readMapBegin(_ktype113, _vtype114, _size112); + uint32_t _i116; + for (_i116 = 0; _i116 < _size112; ++_i116) { - std::string _key111; - xfer += iprot->readString(_key111); - std::string& _val112 = this->configuration[_key111]; - xfer += iprot->readString(_val112); + std::string _key117; + xfer += iprot->readString(_key117); + std::string& _val118 = this->configuration[_key117]; + xfer += iprot->readString(_val118); } xfer += iprot->readMapEnd(); } @@ -2871,11 +2980,11 @@ uint32_t TOpenSessionReq::write(::apache::thrift::protocol::TProtocol* oprot) co xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 4); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); - std::map ::const_iterator _iter113; - for (_iter113 = this->configuration.begin(); _iter113 != this->configuration.end(); ++_iter113) + std::map ::const_iterator _iter119; + for (_iter119 = this->configuration.begin(); _iter119 != this->configuration.end(); ++_iter119) { - xfer += oprot->writeString(_iter113->first); - xfer += oprot->writeString(_iter113->second); + xfer += oprot->writeString(_iter119->first); + xfer += oprot->writeString(_iter119->second); } xfer += oprot->writeMapEnd(); } @@ -2930,9 +3039,9 @@ uint32_t TOpenSessionResp::read(::apache::thrift::protocol::TProtocol* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast114; - xfer += iprot->readI32(ecast114); - this->serverProtocolVersion = (TProtocolVersion::type)ecast114; + int32_t ecast120; + xfer += iprot->readI32(ecast120); + this->serverProtocolVersion = (TProtocolVersion::type)ecast120; isset_serverProtocolVersion = true; } else { xfer += iprot->skip(ftype); @@ -2950,17 +3059,17 @@ uint32_t TOpenSessionResp::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_MAP) { { this->configuration.clear(); - uint32_t _size115; - ::apache::thrift::protocol::TType _ktype116; - ::apache::thrift::protocol::TType _vtype117; - xfer += iprot->readMapBegin(_ktype116, _vtype117, _size115); - uint32_t _i119; - for (_i119 = 0; _i119 < _size115; ++_i119) + uint32_t _size121; + ::apache::thrift::protocol::TType _ktype122; + ::apache::thrift::protocol::TType _vtype123; + xfer += iprot->readMapBegin(_ktype122, _vtype123, _size121); + uint32_t _i125; + for (_i125 = 0; _i125 < _size121; ++_i125) { - std::string _key120; - xfer += iprot->readString(_key120); - std::string& _val121 = this->configuration[_key120]; - xfer += iprot->readString(_val121); + std::string _key126; + xfer += iprot->readString(_key126); + std::string& _val127 = this->configuration[_key126]; + xfer += iprot->readString(_val127); } xfer += iprot->readMapEnd(); } @@ -3006,11 +3115,11 @@ uint32_t TOpenSessionResp::write(::apache::thrift::protocol::TProtocol* oprot) c xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 4); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); - std::map ::const_iterator _iter122; - for (_iter122 = this->configuration.begin(); _iter122 != this->configuration.end(); ++_iter122) + std::map ::const_iterator _iter128; + for (_iter128 = this->configuration.begin(); _iter128 != this->configuration.end(); ++_iter128) { - xfer += oprot->writeString(_iter122->first); - xfer += oprot->writeString(_iter122->second); + xfer += oprot->writeString(_iter128->first); + xfer += oprot->writeString(_iter128->second); } xfer += oprot->writeMapEnd(); } @@ -3320,9 +3429,9 @@ uint32_t TGetInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast123; - xfer += iprot->readI32(ecast123); - this->infoType = (TGetInfoType::type)ecast123; + int32_t ecast129; + xfer += iprot->readI32(ecast129); + this->infoType = (TGetInfoType::type)ecast129; isset_infoType = true; } else { xfer += iprot->skip(ftype); @@ -3492,17 +3601,17 @@ uint32_t TExecuteStatementReq::read(::apache::thrift::protocol::TProtocol* iprot if (ftype == ::apache::thrift::protocol::T_MAP) { { this->confOverlay.clear(); - uint32_t _size124; - ::apache::thrift::protocol::TType _ktype125; - ::apache::thrift::protocol::TType _vtype126; - xfer += iprot->readMapBegin(_ktype125, _vtype126, _size124); - uint32_t _i128; - for (_i128 = 0; _i128 < _size124; ++_i128) + uint32_t _size130; + ::apache::thrift::protocol::TType _ktype131; + ::apache::thrift::protocol::TType _vtype132; + xfer += iprot->readMapBegin(_ktype131, _vtype132, _size130); + uint32_t _i134; + for (_i134 = 0; _i134 < _size130; ++_i134) { - std::string _key129; - xfer += iprot->readString(_key129); - std::string& _val130 = this->confOverlay[_key129]; - xfer += iprot->readString(_val130); + std::string _key135; + xfer += iprot->readString(_key135); + std::string& _val136 = this->confOverlay[_key135]; + xfer += iprot->readString(_val136); } xfer += iprot->readMapEnd(); } @@ -3551,11 +3660,11 @@ uint32_t TExecuteStatementReq::write(::apache::thrift::protocol::TProtocol* opro xfer += oprot->writeFieldBegin("confOverlay", ::apache::thrift::protocol::T_MAP, 3); { xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->confOverlay.size())); - std::map ::const_iterator _iter131; - for (_iter131 = this->confOverlay.begin(); _iter131 != this->confOverlay.end(); ++_iter131) + std::map ::const_iterator _iter137; + for (_iter137 = this->confOverlay.begin(); _iter137 != this->confOverlay.end(); ++_iter137) { - xfer += oprot->writeString(_iter131->first); - xfer += oprot->writeString(_iter131->second); + xfer += oprot->writeString(_iter137->first); + xfer += oprot->writeString(_iter137->second); } xfer += oprot->writeMapEnd(); } @@ -4177,14 +4286,14 @@ uint32_t TGetTablesReq::read(::apache::thrift::protocol::TProtocol* iprot) { if (ftype == ::apache::thrift::protocol::T_LIST) { { this->tableTypes.clear(); - uint32_t _size132; - ::apache::thrift::protocol::TType _etype135; - xfer += iprot->readListBegin(_etype135, _size132); - this->tableTypes.resize(_size132); - uint32_t _i136; - for (_i136 = 0; _i136 < _size132; ++_i136) + uint32_t _size138; + ::apache::thrift::protocol::TType _etype141; + xfer += iprot->readListBegin(_etype141, _size138); + this->tableTypes.resize(_size138); + uint32_t _i142; + for (_i142 = 0; _i142 < _size138; ++_i142) { - xfer += iprot->readString(this->tableTypes[_i136]); + xfer += iprot->readString(this->tableTypes[_i142]); } xfer += iprot->readListEnd(); } @@ -4234,10 +4343,10 @@ uint32_t TGetTablesReq::write(::apache::thrift::protocol::TProtocol* oprot) cons xfer += oprot->writeFieldBegin("tableTypes", ::apache::thrift::protocol::T_LIST, 5); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tableTypes.size())); - std::vector ::const_iterator _iter137; - for (_iter137 = this->tableTypes.begin(); _iter137 != this->tableTypes.end(); ++_iter137) + std::vector ::const_iterator _iter143; + for (_iter143 = this->tableTypes.begin(); _iter143 != this->tableTypes.end(); ++_iter143) { - xfer += oprot->writeString((*_iter137)); + xfer += oprot->writeString((*_iter143)); } xfer += oprot->writeListEnd(); } @@ -4966,9 +5075,9 @@ uint32_t TGetOperationStatusResp::read(::apache::thrift::protocol::TProtocol* ip break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast138; - xfer += iprot->readI32(ecast138); - this->operationState = (TOperationState::type)ecast138; + int32_t ecast144; + xfer += iprot->readI32(ecast144); + this->operationState = (TOperationState::type)ecast144; this->__isset.operationState = true; } else { xfer += iprot->skip(ftype); @@ -5448,9 +5557,9 @@ uint32_t TFetchResultsReq::read(::apache::thrift::protocol::TProtocol* iprot) { break; case 2: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast139; - xfer += iprot->readI32(ecast139); - this->orientation = (TFetchOrientation::type)ecast139; + int32_t ecast145; + xfer += iprot->readI32(ecast145); + this->orientation = (TFetchOrientation::type)ecast145; isset_orientation = true; } else { xfer += iprot->skip(ftype); @@ -5510,8 +5619,8 @@ void swap(TFetchResultsReq &a, TFetchResultsReq &b) { swap(a.maxRows, b.maxRows); } -const char* TFetchResultsResp::ascii_fingerprint = "29891EA4D71B4283E8715DA5B95F2763"; -const uint8_t TFetchResultsResp::binary_fingerprint[16] = {0x29,0x89,0x1E,0xA4,0xD7,0x1B,0x42,0x83,0xE8,0x71,0x5D,0xA5,0xB9,0x5F,0x27,0x63}; +const char* TFetchResultsResp::ascii_fingerprint = "3657F3CAF86F7B41B9D1B6308665A66A"; +const uint8_t TFetchResultsResp::binary_fingerprint[16] = {0x36,0x57,0xF3,0xCA,0xF8,0x6F,0x7B,0x41,0xB9,0xD1,0xB6,0x30,0x86,0x65,0xA6,0x6A}; uint32_t TFetchResultsResp::read(::apache::thrift::protocol::TProtocol* iprot) { diff --git service/src/gen/thrift/gen-cpp/TCLIService_types.h service/src/gen/thrift/gen-cpp/TCLIService_types.h index 490b393..8e49981 100644 --- service/src/gen/thrift/gen-cpp/TCLIService_types.h +++ service/src/gen/thrift/gen-cpp/TCLIService_types.h @@ -1055,8 +1055,54 @@ class TStringValue { void swap(TStringValue &a, TStringValue &b); +typedef struct _TBinaryValue__isset { + _TBinaryValue__isset() : value(false) {} + bool value; +} _TBinaryValue__isset; + +class TBinaryValue { + public: + + static const char* ascii_fingerprint; // = "66E694018C17E5B65A59AE8F55CCA3CD"; + static const uint8_t binary_fingerprint[16]; // = {0x66,0xE6,0x94,0x01,0x8C,0x17,0xE5,0xB6,0x5A,0x59,0xAE,0x8F,0x55,0xCC,0xA3,0xCD}; + + TBinaryValue() : value() { + } + + virtual ~TBinaryValue() throw() {} + + std::string value; + + _TBinaryValue__isset __isset; + + void __set_value(const std::string& val) { + value = val; + __isset.value = true; + } + + bool operator == (const TBinaryValue & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TBinaryValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TBinaryValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +void swap(TBinaryValue &a, TBinaryValue &b); + typedef struct _TColumn__isset { - _TColumn__isset() : boolColumn(false), byteColumn(false), i16Column(false), i32Column(false), i64Column(false), doubleColumn(false), stringColumn(false) {} + _TColumn__isset() : boolColumn(false), byteColumn(false), i16Column(false), i32Column(false), i64Column(false), doubleColumn(false), stringColumn(false), binaryColumn(false) {} bool boolColumn; bool byteColumn; bool i16Column; @@ -1064,13 +1110,14 @@ typedef struct _TColumn__isset { bool i64Column; bool doubleColumn; bool stringColumn; + bool binaryColumn; } _TColumn__isset; class TColumn { public: - static const char* ascii_fingerprint; // = "B39B4E4E565DB31DC891D62FDC3208DC"; - static const uint8_t binary_fingerprint[16]; // = {0xB3,0x9B,0x4E,0x4E,0x56,0x5D,0xB3,0x1D,0xC8,0x91,0xD6,0x2F,0xDC,0x32,0x08,0xDC}; + static const char* ascii_fingerprint; // = "6A1A7F0836F31986E3212216A1D53D06"; + static const uint8_t binary_fingerprint[16]; // = {0x6A,0x1A,0x7F,0x08,0x36,0xF3,0x19,0x86,0xE3,0x21,0x22,0x16,0xA1,0xD5,0x3D,0x06}; TColumn() { } @@ -1084,6 +1131,7 @@ class TColumn { std::vector i64Column; std::vector doubleColumn; std::vector stringColumn; + std::vector binaryColumn; _TColumn__isset __isset; @@ -1115,6 +1163,10 @@ class TColumn { stringColumn = val; } + void __set_binaryColumn(const std::vector & val) { + binaryColumn = val; + } + bool operator == (const TColumn & rhs) const { if (!(boolColumn == rhs.boolColumn)) @@ -1131,6 +1183,8 @@ class TColumn { return false; if (!(stringColumn == rhs.stringColumn)) return false; + if (!(binaryColumn == rhs.binaryColumn)) + return false; return true; } bool operator != (const TColumn &rhs) const { @@ -1147,7 +1201,7 @@ class TColumn { void swap(TColumn &a, TColumn &b); typedef struct _TColumnValue__isset { - _TColumnValue__isset() : boolVal(false), byteVal(false), i16Val(false), i32Val(false), i64Val(false), doubleVal(false), stringVal(false) {} + _TColumnValue__isset() : boolVal(false), byteVal(false), i16Val(false), i32Val(false), i64Val(false), doubleVal(false), stringVal(false), binaryVal(false) {} bool boolVal; bool byteVal; bool i16Val; @@ -1155,13 +1209,14 @@ typedef struct _TColumnValue__isset { bool i64Val; bool doubleVal; bool stringVal; + bool binaryVal; } _TColumnValue__isset; class TColumnValue { public: - static const char* ascii_fingerprint; // = "C2DDD988447EA7999A8285AA38AAE9AD"; - static const uint8_t binary_fingerprint[16]; // = {0xC2,0xDD,0xD9,0x88,0x44,0x7E,0xA7,0x99,0x9A,0x82,0x85,0xAA,0x38,0xAA,0xE9,0xAD}; + static const char* ascii_fingerprint; // = "732FCA3EB6DEA77690296E3F386F8467"; + static const uint8_t binary_fingerprint[16]; // = {0x73,0x2F,0xCA,0x3E,0xB6,0xDE,0xA7,0x76,0x90,0x29,0x6E,0x3F,0x38,0x6F,0x84,0x67}; TColumnValue() { } @@ -1175,6 +1230,7 @@ class TColumnValue { TI64Value i64Val; TDoubleValue doubleVal; TStringValue stringVal; + TBinaryValue binaryVal; _TColumnValue__isset __isset; @@ -1206,6 +1262,10 @@ class TColumnValue { stringVal = val; } + void __set_binaryVal(const TBinaryValue& val) { + binaryVal = val; + } + bool operator == (const TColumnValue & rhs) const { if (!(boolVal == rhs.boolVal)) @@ -1222,6 +1282,8 @@ class TColumnValue { return false; if (!(stringVal == rhs.stringVal)) return false; + if (!(binaryVal == rhs.binaryVal)) + return false; return true; } bool operator != (const TColumnValue &rhs) const { @@ -1241,8 +1303,8 @@ void swap(TColumnValue &a, TColumnValue &b); class TRow { public: - static const char* ascii_fingerprint; // = "E73FD1FCA0CA58A669FC3E02FB68D534"; - static const uint8_t binary_fingerprint[16]; // = {0xE7,0x3F,0xD1,0xFC,0xA0,0xCA,0x58,0xA6,0x69,0xFC,0x3E,0x02,0xFB,0x68,0xD5,0x34}; + static const char* ascii_fingerprint; // = "99AF3D0597DDA00BF09BB2A98402239F"; + static const uint8_t binary_fingerprint[16]; // = {0x99,0xAF,0x3D,0x05,0x97,0xDD,0xA0,0x0B,0xF0,0x9B,0xB2,0xA9,0x84,0x02,0x23,0x9F}; TRow() { } @@ -1282,8 +1344,8 @@ typedef struct _TRowSet__isset { class TRowSet { public: - static const char* ascii_fingerprint; // = "698727A24268879440EE0DAFE68FC1C5"; - static const uint8_t binary_fingerprint[16]; // = {0x69,0x87,0x27,0xA2,0x42,0x68,0x87,0x94,0x40,0xEE,0x0D,0xAF,0xE6,0x8F,0xC1,0xC5}; + static const char* ascii_fingerprint; // = "AE2923283250406F5034170469433DDB"; + static const uint8_t binary_fingerprint[16]; // = {0xAE,0x29,0x23,0x28,0x32,0x50,0x40,0x6F,0x50,0x34,0x17,0x04,0x69,0x43,0x3D,0xDB}; TRowSet() : startRowOffset(0) { } @@ -3266,8 +3328,8 @@ typedef struct _TFetchResultsResp__isset { class TFetchResultsResp { public: - static const char* ascii_fingerprint; // = "29891EA4D71B4283E8715DA5B95F2763"; - static const uint8_t binary_fingerprint[16]; // = {0x29,0x89,0x1E,0xA4,0xD7,0x1B,0x42,0x83,0xE8,0x71,0x5D,0xA5,0xB9,0x5F,0x27,0x63}; + static const char* ascii_fingerprint; // = "3657F3CAF86F7B41B9D1B6308665A66A"; + static const uint8_t binary_fingerprint[16]; // = {0x36,0x57,0xF3,0xCA,0xF8,0x6F,0x7B,0x41,0xB9,0xD1,0xB6,0x30,0x86,0x65,0xA6,0x6A}; TFetchResultsResp() : hasMoreRows(0) { } diff --git service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java index 1c44789..745e6cc 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java +++ service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java @@ -3023,7 +3023,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, fetchN_result struc struct.success = new ArrayList(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { - String _elem2; // optional + String _elem2; // required _elem2 = iprot.readString(); struct.success.add(_elem2); } @@ -3122,7 +3122,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, fetchN_result struct struct.success = new ArrayList(_list5.size); for (int _i6 = 0; _i6 < _list5.size; ++_i6) { - String _elem7; // optional + String _elem7; // required _elem7 = iprot.readString(); struct.success.add(_elem7); } @@ -3785,7 +3785,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, fetchAll_result str struct.success = new ArrayList(_list8.size); for (int _i9 = 0; _i9 < _list8.size; ++_i9) { - String _elem10; // optional + String _elem10; // required _elem10 = iprot.readString(); struct.success.add(_elem10); } @@ -3884,7 +3884,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, fetchAll_result stru struct.success = new ArrayList(_list13.size); for (int _i14 = 0; _i14 < _list13.size; ++_i14) { - String _elem15; // optional + String _elem15; // required _elem15 = iprot.readString(); struct.success.add(_elem15); } diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBinaryValue.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBinaryValue.java new file mode 100644 index 0000000..dfe9515 --- /dev/null +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBinaryValue.java @@ -0,0 +1,399 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hive.service.cli.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TBinaryValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBinaryValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBinaryValueTupleSchemeFactory()); + } + + private ByteBuffer value; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + VALUE((short)1, "value"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private _Fields optionals[] = {_Fields.VALUE}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryValue.class, metaDataMap); + } + + public TBinaryValue() { + } + + /** + * Performs a deep copy on other. + */ + public TBinaryValue(TBinaryValue other) { + if (other.isSetValue()) { + this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value); +; + } + } + + public TBinaryValue deepCopy() { + return new TBinaryValue(this); + } + + @Override + public void clear() { + this.value = null; + } + + public byte[] getValue() { + setValue(org.apache.thrift.TBaseHelper.rightSize(value)); + return value == null ? null : value.array(); + } + + public ByteBuffer bufferForValue() { + return value; + } + + public void setValue(byte[] value) { + setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value)); + } + + public void setValue(ByteBuffer value) { + this.value = value; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TBinaryValue) + return this.equals((TBinaryValue)that); + return false; + } + + public boolean equals(TBinaryValue that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_value = true && (isSetValue()); + builder.append(present_value); + if (present_value) + builder.append(value); + + return builder.toHashCode(); + } + + public int compareTo(TBinaryValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TBinaryValue typedOther = (TBinaryValue)other; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TBinaryValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.value, sb); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class TBinaryValueStandardSchemeFactory implements SchemeFactory { + public TBinaryValueStandardScheme getScheme() { + return new TBinaryValueStandardScheme(); + } + } + + private static class TBinaryValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TBinaryValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.value != null) { + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TBinaryValueTupleSchemeFactory implements SchemeFactory { + public TBinaryValueTupleScheme getScheme() { + return new TBinaryValueTupleScheme(); + } + } + + private static class TBinaryValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryValue struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryValue struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java index 497cc01..6f235c5 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java @@ -40,6 +40,7 @@ private static final org.apache.thrift.protocol.TField I64_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Column", org.apache.thrift.protocol.TType.LIST, (short)5); private static final org.apache.thrift.protocol.TField DOUBLE_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleColumn", org.apache.thrift.protocol.TType.LIST, (short)6); private static final org.apache.thrift.protocol.TField STRING_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("stringColumn", org.apache.thrift.protocol.TType.LIST, (short)7); + private static final org.apache.thrift.protocol.TField BINARY_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumn", org.apache.thrift.protocol.TType.LIST, (short)8); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -49,7 +50,8 @@ I32_COLUMN((short)4, "i32Column"), I64_COLUMN((short)5, "i64Column"), DOUBLE_COLUMN((short)6, "doubleColumn"), - STRING_COLUMN((short)7, "stringColumn"); + STRING_COLUMN((short)7, "stringColumn"), + BINARY_COLUMN((short)8, "binaryColumn"); private static final Map byName = new HashMap(); @@ -78,6 +80,8 @@ public static _Fields findByThriftId(int fieldId) { return DOUBLE_COLUMN; case 7: // STRING_COLUMN return STRING_COLUMN; + case 8: // BINARY_COLUMN + return BINARY_COLUMN; default: return null; } @@ -141,6 +145,9 @@ public String getFieldName() { tmpMap.put(_Fields.STRING_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("stringColumn", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class)))); + tmpMap.put(_Fields.BINARY_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("binaryColumn", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryValue.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); } @@ -202,6 +209,12 @@ public static TColumn stringColumn(List value) { return x; } + public static TColumn binaryColumn(List value) { + TColumn x = new TColumn(); + x.setBinaryColumn(value); + return x; + } + @Override protected void checkType(_Fields setField, Object value) throws ClassCastException { @@ -241,6 +254,11 @@ protected void checkType(_Fields setField, Object value) throws ClassCastExcepti break; } throw new ClassCastException("Was expecting value of type List for field 'stringColumn', but got " + value.getClass().getSimpleName()); + case BINARY_COLUMN: + if (value instanceof List) { + break; + } + throw new ClassCastException("Was expecting value of type List for field 'binaryColumn', but got " + value.getClass().getSimpleName()); default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -259,7 +277,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip boolColumn = new ArrayList(_list46.size); for (int _i47 = 0; _i47 < _list46.size; ++_i47) { - TBoolValue _elem48; // optional + TBoolValue _elem48; // required _elem48 = new TBoolValue(); _elem48.read(iprot); boolColumn.add(_elem48); @@ -279,7 +297,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip byteColumn = new ArrayList(_list49.size); for (int _i50 = 0; _i50 < _list49.size; ++_i50) { - TByteValue _elem51; // optional + TByteValue _elem51; // required _elem51 = new TByteValue(); _elem51.read(iprot); byteColumn.add(_elem51); @@ -299,7 +317,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip i16Column = new ArrayList(_list52.size); for (int _i53 = 0; _i53 < _list52.size; ++_i53) { - TI16Value _elem54; // optional + TI16Value _elem54; // required _elem54 = new TI16Value(); _elem54.read(iprot); i16Column.add(_elem54); @@ -319,7 +337,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip i32Column = new ArrayList(_list55.size); for (int _i56 = 0; _i56 < _list55.size; ++_i56) { - TI32Value _elem57; // optional + TI32Value _elem57; // required _elem57 = new TI32Value(); _elem57.read(iprot); i32Column.add(_elem57); @@ -339,7 +357,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip i64Column = new ArrayList(_list58.size); for (int _i59 = 0; _i59 < _list58.size; ++_i59) { - TI64Value _elem60; // optional + TI64Value _elem60; // required _elem60 = new TI64Value(); _elem60.read(iprot); i64Column.add(_elem60); @@ -359,7 +377,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip doubleColumn = new ArrayList(_list61.size); for (int _i62 = 0; _i62 < _list61.size; ++_i62) { - TDoubleValue _elem63; // optional + TDoubleValue _elem63; // required _elem63 = new TDoubleValue(); _elem63.read(iprot); doubleColumn.add(_elem63); @@ -379,7 +397,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip stringColumn = new ArrayList(_list64.size); for (int _i65 = 0; _i65 < _list64.size; ++_i65) { - TStringValue _elem66; // optional + TStringValue _elem66; // required _elem66 = new TStringValue(); _elem66.read(iprot); stringColumn.add(_elem66); @@ -391,6 +409,26 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } + case BINARY_COLUMN: + if (field.type == BINARY_COLUMN_FIELD_DESC.type) { + List binaryColumn; + { + org.apache.thrift.protocol.TList _list67 = iprot.readListBegin(); + binaryColumn = new ArrayList(_list67.size); + for (int _i68 = 0; _i68 < _list67.size; ++_i68) + { + TBinaryValue _elem69; // required + _elem69 = new TBinaryValue(); + _elem69.read(iprot); + binaryColumn.add(_elem69); + } + iprot.readListEnd(); + } + return binaryColumn; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } default: throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } @@ -406,9 +444,9 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr List boolColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, boolColumn.size())); - for (TBoolValue _iter67 : boolColumn) + for (TBoolValue _iter70 : boolColumn) { - _iter67.write(oprot); + _iter70.write(oprot); } oprot.writeListEnd(); } @@ -417,9 +455,9 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr List byteColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, byteColumn.size())); - for (TByteValue _iter68 : byteColumn) + for (TByteValue _iter71 : byteColumn) { - _iter68.write(oprot); + _iter71.write(oprot); } oprot.writeListEnd(); } @@ -428,9 +466,9 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr List i16Column = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i16Column.size())); - for (TI16Value _iter69 : i16Column) + for (TI16Value _iter72 : i16Column) { - _iter69.write(oprot); + _iter72.write(oprot); } oprot.writeListEnd(); } @@ -439,9 +477,9 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr List i32Column = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i32Column.size())); - for (TI32Value _iter70 : i32Column) + for (TI32Value _iter73 : i32Column) { - _iter70.write(oprot); + _iter73.write(oprot); } oprot.writeListEnd(); } @@ -450,9 +488,9 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr List i64Column = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i64Column.size())); - for (TI64Value _iter71 : i64Column) + for (TI64Value _iter74 : i64Column) { - _iter71.write(oprot); + _iter74.write(oprot); } oprot.writeListEnd(); } @@ -461,9 +499,9 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr List doubleColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, doubleColumn.size())); - for (TDoubleValue _iter72 : doubleColumn) + for (TDoubleValue _iter75 : doubleColumn) { - _iter72.write(oprot); + _iter75.write(oprot); } oprot.writeListEnd(); } @@ -472,9 +510,20 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr List stringColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, stringColumn.size())); - for (TStringValue _iter73 : stringColumn) + for (TStringValue _iter76 : stringColumn) { - _iter73.write(oprot); + _iter76.write(oprot); + } + oprot.writeListEnd(); + } + return; + case BINARY_COLUMN: + List binaryColumn = (List)value_; + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, binaryColumn.size())); + for (TBinaryValue _iter77 : binaryColumn) + { + _iter77.write(oprot); } oprot.writeListEnd(); } @@ -492,14 +541,14 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot case BOOL_COLUMN: List boolColumn; { - org.apache.thrift.protocol.TList _list74 = iprot.readListBegin(); - boolColumn = new ArrayList(_list74.size); - for (int _i75 = 0; _i75 < _list74.size; ++_i75) + org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); + boolColumn = new ArrayList(_list78.size); + for (int _i79 = 0; _i79 < _list78.size; ++_i79) { - TBoolValue _elem76; // optional - _elem76 = new TBoolValue(); - _elem76.read(iprot); - boolColumn.add(_elem76); + TBoolValue _elem80; // required + _elem80 = new TBoolValue(); + _elem80.read(iprot); + boolColumn.add(_elem80); } iprot.readListEnd(); } @@ -507,14 +556,14 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot case BYTE_COLUMN: List byteColumn; { - org.apache.thrift.protocol.TList _list77 = iprot.readListBegin(); - byteColumn = new ArrayList(_list77.size); - for (int _i78 = 0; _i78 < _list77.size; ++_i78) + org.apache.thrift.protocol.TList _list81 = iprot.readListBegin(); + byteColumn = new ArrayList(_list81.size); + for (int _i82 = 0; _i82 < _list81.size; ++_i82) { - TByteValue _elem79; // optional - _elem79 = new TByteValue(); - _elem79.read(iprot); - byteColumn.add(_elem79); + TByteValue _elem83; // required + _elem83 = new TByteValue(); + _elem83.read(iprot); + byteColumn.add(_elem83); } iprot.readListEnd(); } @@ -522,14 +571,14 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot case I16_COLUMN: List i16Column; { - org.apache.thrift.protocol.TList _list80 = iprot.readListBegin(); - i16Column = new ArrayList(_list80.size); - for (int _i81 = 0; _i81 < _list80.size; ++_i81) + org.apache.thrift.protocol.TList _list84 = iprot.readListBegin(); + i16Column = new ArrayList(_list84.size); + for (int _i85 = 0; _i85 < _list84.size; ++_i85) { - TI16Value _elem82; // optional - _elem82 = new TI16Value(); - _elem82.read(iprot); - i16Column.add(_elem82); + TI16Value _elem86; // required + _elem86 = new TI16Value(); + _elem86.read(iprot); + i16Column.add(_elem86); } iprot.readListEnd(); } @@ -537,14 +586,14 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot case I32_COLUMN: List i32Column; { - org.apache.thrift.protocol.TList _list83 = iprot.readListBegin(); - i32Column = new ArrayList(_list83.size); - for (int _i84 = 0; _i84 < _list83.size; ++_i84) + org.apache.thrift.protocol.TList _list87 = iprot.readListBegin(); + i32Column = new ArrayList(_list87.size); + for (int _i88 = 0; _i88 < _list87.size; ++_i88) { - TI32Value _elem85; // optional - _elem85 = new TI32Value(); - _elem85.read(iprot); - i32Column.add(_elem85); + TI32Value _elem89; // required + _elem89 = new TI32Value(); + _elem89.read(iprot); + i32Column.add(_elem89); } iprot.readListEnd(); } @@ -552,14 +601,14 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot case I64_COLUMN: List i64Column; { - org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); - i64Column = new ArrayList(_list86.size); - for (int _i87 = 0; _i87 < _list86.size; ++_i87) + org.apache.thrift.protocol.TList _list90 = iprot.readListBegin(); + i64Column = new ArrayList(_list90.size); + for (int _i91 = 0; _i91 < _list90.size; ++_i91) { - TI64Value _elem88; // optional - _elem88 = new TI64Value(); - _elem88.read(iprot); - i64Column.add(_elem88); + TI64Value _elem92; // required + _elem92 = new TI64Value(); + _elem92.read(iprot); + i64Column.add(_elem92); } iprot.readListEnd(); } @@ -567,14 +616,14 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot case DOUBLE_COLUMN: List doubleColumn; { - org.apache.thrift.protocol.TList _list89 = iprot.readListBegin(); - doubleColumn = new ArrayList(_list89.size); - for (int _i90 = 0; _i90 < _list89.size; ++_i90) + org.apache.thrift.protocol.TList _list93 = iprot.readListBegin(); + doubleColumn = new ArrayList(_list93.size); + for (int _i94 = 0; _i94 < _list93.size; ++_i94) { - TDoubleValue _elem91; // optional - _elem91 = new TDoubleValue(); - _elem91.read(iprot); - doubleColumn.add(_elem91); + TDoubleValue _elem95; // required + _elem95 = new TDoubleValue(); + _elem95.read(iprot); + doubleColumn.add(_elem95); } iprot.readListEnd(); } @@ -582,18 +631,33 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot case STRING_COLUMN: List stringColumn; { - org.apache.thrift.protocol.TList _list92 = iprot.readListBegin(); - stringColumn = new ArrayList(_list92.size); - for (int _i93 = 0; _i93 < _list92.size; ++_i93) + org.apache.thrift.protocol.TList _list96 = iprot.readListBegin(); + stringColumn = new ArrayList(_list96.size); + for (int _i97 = 0; _i97 < _list96.size; ++_i97) { - TStringValue _elem94; // optional - _elem94 = new TStringValue(); - _elem94.read(iprot); - stringColumn.add(_elem94); + TStringValue _elem98; // required + _elem98 = new TStringValue(); + _elem98.read(iprot); + stringColumn.add(_elem98); } iprot.readListEnd(); } return stringColumn; + case BINARY_COLUMN: + List binaryColumn; + { + org.apache.thrift.protocol.TList _list99 = iprot.readListBegin(); + binaryColumn = new ArrayList(_list99.size); + for (int _i100 = 0; _i100 < _list99.size; ++_i100) + { + TBinaryValue _elem101; // required + _elem101 = new TBinaryValue(); + _elem101.read(iprot); + binaryColumn.add(_elem101); + } + iprot.readListEnd(); + } + return binaryColumn; default: throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } @@ -609,9 +673,9 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) List boolColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, boolColumn.size())); - for (TBoolValue _iter95 : boolColumn) + for (TBoolValue _iter102 : boolColumn) { - _iter95.write(oprot); + _iter102.write(oprot); } oprot.writeListEnd(); } @@ -620,9 +684,9 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) List byteColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, byteColumn.size())); - for (TByteValue _iter96 : byteColumn) + for (TByteValue _iter103 : byteColumn) { - _iter96.write(oprot); + _iter103.write(oprot); } oprot.writeListEnd(); } @@ -631,9 +695,9 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) List i16Column = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i16Column.size())); - for (TI16Value _iter97 : i16Column) + for (TI16Value _iter104 : i16Column) { - _iter97.write(oprot); + _iter104.write(oprot); } oprot.writeListEnd(); } @@ -642,9 +706,9 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) List i32Column = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i32Column.size())); - for (TI32Value _iter98 : i32Column) + for (TI32Value _iter105 : i32Column) { - _iter98.write(oprot); + _iter105.write(oprot); } oprot.writeListEnd(); } @@ -653,9 +717,9 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) List i64Column = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i64Column.size())); - for (TI64Value _iter99 : i64Column) + for (TI64Value _iter106 : i64Column) { - _iter99.write(oprot); + _iter106.write(oprot); } oprot.writeListEnd(); } @@ -664,9 +728,9 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) List doubleColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, doubleColumn.size())); - for (TDoubleValue _iter100 : doubleColumn) + for (TDoubleValue _iter107 : doubleColumn) { - _iter100.write(oprot); + _iter107.write(oprot); } oprot.writeListEnd(); } @@ -675,9 +739,20 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) List stringColumn = (List)value_; { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, stringColumn.size())); - for (TStringValue _iter101 : stringColumn) + for (TStringValue _iter108 : stringColumn) + { + _iter108.write(oprot); + } + oprot.writeListEnd(); + } + return; + case BINARY_COLUMN: + List binaryColumn = (List)value_; + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, binaryColumn.size())); + for (TBinaryValue _iter109 : binaryColumn) { - _iter101.write(oprot); + _iter109.write(oprot); } oprot.writeListEnd(); } @@ -704,6 +779,8 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) return DOUBLE_COLUMN_FIELD_DESC; case STRING_COLUMN: return STRING_COLUMN_FIELD_DESC; + case BINARY_COLUMN: + return BINARY_COLUMN_FIELD_DESC; default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -822,6 +899,20 @@ public void setStringColumn(List value) { value_ = value; } + public List getBinaryColumn() { + if (getSetField() == _Fields.BINARY_COLUMN) { + return (List)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'binaryColumn' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBinaryColumn(List value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BINARY_COLUMN; + value_ = value; + } + public boolean isSetBoolColumn() { return setField_ == _Fields.BOOL_COLUMN; } @@ -857,6 +948,11 @@ public boolean isSetStringColumn() { } + public boolean isSetBinaryColumn() { + return setField_ == _Fields.BINARY_COLUMN; + } + + public boolean equals(Object other) { if (other instanceof TColumn) { return equals((TColumn)other); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumnValue.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumnValue.java index 44da2cd..27b5036 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumnValue.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumnValue.java @@ -40,6 +40,7 @@ private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); + private static final org.apache.thrift.protocol.TField BINARY_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryVal", org.apache.thrift.protocol.TType.STRUCT, (short)8); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -49,7 +50,8 @@ I32_VAL((short)4, "i32Val"), I64_VAL((short)5, "i64Val"), DOUBLE_VAL((short)6, "doubleVal"), - STRING_VAL((short)7, "stringVal"); + STRING_VAL((short)7, "stringVal"), + BINARY_VAL((short)8, "binaryVal"); private static final Map byName = new HashMap(); @@ -78,6 +80,8 @@ public static _Fields findByThriftId(int fieldId) { return DOUBLE_VAL; case 7: // STRING_VAL return STRING_VAL; + case 8: // BINARY_VAL + return BINARY_VAL; default: return null; } @@ -134,6 +138,8 @@ public String getFieldName() { new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); + tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryValue.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); } @@ -195,6 +201,12 @@ public static TColumnValue stringVal(TStringValue value) { return x; } + public static TColumnValue binaryVal(TBinaryValue value) { + TColumnValue x = new TColumnValue(); + x.setBinaryVal(value); + return x; + } + @Override protected void checkType(_Fields setField, Object value) throws ClassCastException { @@ -234,6 +246,11 @@ protected void checkType(_Fields setField, Object value) throws ClassCastExcepti break; } throw new ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); + case BINARY_VAL: + if (value instanceof TBinaryValue) { + break; + } + throw new ClassCastException("Was expecting value of type TBinaryValue for field 'binaryVal', but got " + value.getClass().getSimpleName()); default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -314,6 +331,16 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); return null; } + case BINARY_VAL: + if (field.type == BINARY_VAL_FIELD_DESC.type) { + TBinaryValue binaryVal; + binaryVal = new TBinaryValue(); + binaryVal.read(iprot); + return binaryVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } default: throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } @@ -353,6 +380,10 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr TStringValue stringVal = (TStringValue)value_; stringVal.write(oprot); return; + case BINARY_VAL: + TBinaryValue binaryVal = (TBinaryValue)value_; + binaryVal.write(oprot); + return; default: throw new IllegalStateException("Cannot write union with unknown field " + setField_); } @@ -398,6 +429,11 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot stringVal = new TStringValue(); stringVal.read(iprot); return stringVal; + case BINARY_VAL: + TBinaryValue binaryVal; + binaryVal = new TBinaryValue(); + binaryVal.read(iprot); + return binaryVal; default: throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } @@ -437,6 +473,10 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) TStringValue stringVal = (TStringValue)value_; stringVal.write(oprot); return; + case BINARY_VAL: + TBinaryValue binaryVal = (TBinaryValue)value_; + binaryVal.write(oprot); + return; default: throw new IllegalStateException("Cannot write union with unknown field " + setField_); } @@ -459,6 +499,8 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) return DOUBLE_VAL_FIELD_DESC; case STRING_VAL: return STRING_VAL_FIELD_DESC; + case BINARY_VAL: + return BINARY_VAL_FIELD_DESC; default: throw new IllegalArgumentException("Unknown field id " + setField); } @@ -577,6 +619,20 @@ public void setStringVal(TStringValue value) { value_ = value; } + public TBinaryValue getBinaryVal() { + if (getSetField() == _Fields.BINARY_VAL) { + return (TBinaryValue)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBinaryVal(TBinaryValue value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BINARY_VAL; + value_ = value; + } + public boolean isSetBoolVal() { return setField_ == _Fields.BOOL_VAL; } @@ -612,6 +668,11 @@ public boolean isSetStringVal() { } + public boolean isSetBinaryVal() { + return setField_ == _Fields.BINARY_VAL; + } + + public boolean equals(Object other) { if (other instanceof TColumnValue) { return equals((TColumnValue)other); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TExecuteStatementReq.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TExecuteStatementReq.java index ea656ac..4f157ad 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TExecuteStatementReq.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TExecuteStatementReq.java @@ -624,15 +624,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementRe case 3: // CONF_OVERLAY if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map154 = iprot.readMapBegin(); - struct.confOverlay = new HashMap(2*_map154.size); - for (int _i155 = 0; _i155 < _map154.size; ++_i155) + org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); + struct.confOverlay = new HashMap(2*_map162.size); + for (int _i163 = 0; _i163 < _map162.size; ++_i163) { - String _key156; // required - String _val157; // required - _key156 = iprot.readString(); - _val157 = iprot.readString(); - struct.confOverlay.put(_key156, _val157); + String _key164; // required + String _val165; // required + _key164 = iprot.readString(); + _val165 = iprot.readString(); + struct.confOverlay.put(_key164, _val165); } iprot.readMapEnd(); } @@ -677,10 +677,10 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); - for (Map.Entry _iter158 : struct.confOverlay.entrySet()) + for (Map.Entry _iter166 : struct.confOverlay.entrySet()) { - oprot.writeString(_iter158.getKey()); - oprot.writeString(_iter158.getValue()); + oprot.writeString(_iter166.getKey()); + oprot.writeString(_iter166.getValue()); } oprot.writeMapEnd(); } @@ -722,10 +722,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe if (struct.isSetConfOverlay()) { { oprot.writeI32(struct.confOverlay.size()); - for (Map.Entry _iter159 : struct.confOverlay.entrySet()) + for (Map.Entry _iter167 : struct.confOverlay.entrySet()) { - oprot.writeString(_iter159.getKey()); - oprot.writeString(_iter159.getValue()); + oprot.writeString(_iter167.getKey()); + oprot.writeString(_iter167.getValue()); } } } @@ -745,15 +745,15 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map160 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.confOverlay = new HashMap(2*_map160.size); - for (int _i161 = 0; _i161 < _map160.size; ++_i161) + org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.confOverlay = new HashMap(2*_map168.size); + for (int _i169 = 0; _i169 < _map168.size; ++_i169) { - String _key162; // required - String _val163; // required - _key162 = iprot.readString(); - _val163 = iprot.readString(); - struct.confOverlay.put(_key162, _val163); + String _key170; // required + String _val171; // required + _key170 = iprot.readString(); + _val171 = iprot.readString(); + struct.confOverlay.put(_key170, _val171); } } struct.setConfOverlayIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java index 1cb5147..d0c3059 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java @@ -711,13 +711,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struc case 5: // TABLE_TYPES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list164 = iprot.readListBegin(); - struct.tableTypes = new ArrayList(_list164.size); - for (int _i165 = 0; _i165 < _list164.size; ++_i165) + org.apache.thrift.protocol.TList _list172 = iprot.readListBegin(); + struct.tableTypes = new ArrayList(_list172.size); + for (int _i173 = 0; _i173 < _list172.size; ++_i173) { - String _elem166; // optional - _elem166 = iprot.readString(); - struct.tableTypes.add(_elem166); + String _elem174; // required + _elem174 = iprot.readString(); + struct.tableTypes.add(_elem174); } iprot.readListEnd(); } @@ -770,9 +770,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq stru oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (String _iter167 : struct.tableTypes) + for (String _iter175 : struct.tableTypes) { - oprot.writeString(_iter167); + oprot.writeString(_iter175); } oprot.writeListEnd(); } @@ -823,9 +823,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struc if (struct.isSetTableTypes()) { { oprot.writeI32(struct.tableTypes.size()); - for (String _iter168 : struct.tableTypes) + for (String _iter176 : struct.tableTypes) { - oprot.writeString(_iter168); + oprot.writeString(_iter176); } } } @@ -852,13 +852,13 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct } if (incoming.get(3)) { { - org.apache.thrift.protocol.TList _list169 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new ArrayList(_list169.size); - for (int _i170 = 0; _i170 < _list169.size; ++_i170) + org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tableTypes = new ArrayList(_list177.size); + for (int _i178 = 0; _i178 < _list177.size; ++_i178) { - String _elem171; // optional - _elem171 = iprot.readString(); - struct.tableTypes.add(_elem171); + String _elem179; // required + _elem179 = iprot.readString(); + struct.tableTypes.add(_elem179); } } struct.setTableTypesIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java index 8ab8297..40b81c2 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java @@ -638,15 +638,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq str case 4: // CONFIGURATION if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map134 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map134.size); - for (int _i135 = 0; _i135 < _map134.size; ++_i135) + org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map142.size); + for (int _i143 = 0; _i143 < _map142.size; ++_i143) { - String _key136; // required - String _val137; // required - _key136 = iprot.readString(); - _val137 = iprot.readString(); - struct.configuration.put(_key136, _val137); + String _key144; // required + String _val145; // required + _key144 = iprot.readString(); + _val145 = iprot.readString(); + struct.configuration.put(_key144, _val145); } iprot.readMapEnd(); } @@ -692,10 +692,10 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq st oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter138 : struct.configuration.entrySet()) + for (Map.Entry _iter146 : struct.configuration.entrySet()) { - oprot.writeString(_iter138.getKey()); - oprot.writeString(_iter138.getValue()); + oprot.writeString(_iter146.getKey()); + oprot.writeString(_iter146.getValue()); } oprot.writeMapEnd(); } @@ -740,10 +740,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq str if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter139 : struct.configuration.entrySet()) + for (Map.Entry _iter147 : struct.configuration.entrySet()) { - oprot.writeString(_iter139.getKey()); - oprot.writeString(_iter139.getValue()); + oprot.writeString(_iter147.getKey()); + oprot.writeString(_iter147.getValue()); } } } @@ -765,15 +765,15 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq stru } if (incoming.get(2)) { { - org.apache.thrift.protocol.TMap _map140 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map140.size); - for (int _i141 = 0; _i141 < _map140.size; ++_i141) + org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new HashMap(2*_map148.size); + for (int _i149 = 0; _i149 < _map148.size; ++_i149) { - String _key142; // required - String _val143; // required - _key142 = iprot.readString(); - _val143 = iprot.readString(); - struct.configuration.put(_key142, _val143); + String _key150; // required + String _val151; // required + _key150 = iprot.readString(); + _val151 = iprot.readString(); + struct.configuration.put(_key150, _val151); } } struct.setConfigurationIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java index 5d353f7..cb3e991 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java @@ -650,15 +650,15 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp st case 4: // CONFIGURATION if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map144 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map144.size); - for (int _i145 = 0; _i145 < _map144.size; ++_i145) + org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map152.size); + for (int _i153 = 0; _i153 < _map152.size; ++_i153) { - String _key146; // required - String _val147; // required - _key146 = iprot.readString(); - _val147 = iprot.readString(); - struct.configuration.put(_key146, _val147); + String _key154; // required + String _val155; // required + _key154 = iprot.readString(); + _val155 = iprot.readString(); + struct.configuration.put(_key154, _val155); } iprot.readMapEnd(); } @@ -702,10 +702,10 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp s oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter148 : struct.configuration.entrySet()) + for (Map.Entry _iter156 : struct.configuration.entrySet()) { - oprot.writeString(_iter148.getKey()); - oprot.writeString(_iter148.getValue()); + oprot.writeString(_iter156.getKey()); + oprot.writeString(_iter156.getValue()); } oprot.writeMapEnd(); } @@ -745,10 +745,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp st if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter149 : struct.configuration.entrySet()) + for (Map.Entry _iter157 : struct.configuration.entrySet()) { - oprot.writeString(_iter149.getKey()); - oprot.writeString(_iter149.getValue()); + oprot.writeString(_iter157.getKey()); + oprot.writeString(_iter157.getValue()); } } } @@ -770,15 +770,15 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp str } if (incoming.get(1)) { { - org.apache.thrift.protocol.TMap _map150 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map150.size); - for (int _i151 = 0; _i151 < _map150.size; ++_i151) + org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new HashMap(2*_map158.size); + for (int _i159 = 0; _i159 < _map158.size; ++_i159) { - String _key152; // required - String _val153; // required - _key152 = iprot.readString(); - _val153 = iprot.readString(); - struct.configuration.put(_key152, _val153); + String _key160; // required + String _val161; // required + _key160 = iprot.readString(); + _val161 = iprot.readString(); + struct.configuration.put(_key160, _val161); } } struct.setConfigurationIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java index 0b6772c..da03246 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java @@ -350,14 +350,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRow struct) throws case 1: // COL_VALS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); - struct.colVals = new ArrayList(_list102.size); - for (int _i103 = 0; _i103 < _list102.size; ++_i103) + org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); + struct.colVals = new ArrayList(_list110.size); + for (int _i111 = 0; _i111 < _list110.size; ++_i111) { - TColumnValue _elem104; // optional - _elem104 = new TColumnValue(); - _elem104.read(iprot); - struct.colVals.add(_elem104); + TColumnValue _elem112; // required + _elem112 = new TColumnValue(); + _elem112.read(iprot); + struct.colVals.add(_elem112); } iprot.readListEnd(); } @@ -383,9 +383,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRow struct) throw oprot.writeFieldBegin(COL_VALS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.colVals.size())); - for (TColumnValue _iter105 : struct.colVals) + for (TColumnValue _iter113 : struct.colVals) { - _iter105.write(oprot); + _iter113.write(oprot); } oprot.writeListEnd(); } @@ -410,9 +410,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.colVals.size()); - for (TColumnValue _iter106 : struct.colVals) + for (TColumnValue _iter114 : struct.colVals) { - _iter106.write(oprot); + _iter114.write(oprot); } } } @@ -421,14 +421,14 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { - org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.colVals = new ArrayList(_list107.size); - for (int _i108 = 0; _i108 < _list107.size; ++_i108) + org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.colVals = new ArrayList(_list115.size); + for (int _i116 = 0; _i116 < _list115.size; ++_i116) { - TColumnValue _elem109; // optional - _elem109 = new TColumnValue(); - _elem109.read(iprot); - struct.colVals.add(_elem109); + TColumnValue _elem117; // required + _elem117 = new TColumnValue(); + _elem117.read(iprot); + struct.colVals.add(_elem117); } } struct.setColValsIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java index db2262d..4bb5749 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java @@ -545,14 +545,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) thr case 2: // ROWS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - struct.rows = new ArrayList(_list110.size); - for (int _i111 = 0; _i111 < _list110.size; ++_i111) + org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); + struct.rows = new ArrayList(_list118.size); + for (int _i119 = 0; _i119 < _list118.size; ++_i119) { - TRow _elem112; // optional - _elem112 = new TRow(); - _elem112.read(iprot); - struct.rows.add(_elem112); + TRow _elem120; // required + _elem120 = new TRow(); + _elem120.read(iprot); + struct.rows.add(_elem120); } iprot.readListEnd(); } @@ -564,14 +564,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) thr case 3: // COLUMNS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list113 = iprot.readListBegin(); - struct.columns = new ArrayList(_list113.size); - for (int _i114 = 0; _i114 < _list113.size; ++_i114) + org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); + struct.columns = new ArrayList(_list121.size); + for (int _i122 = 0; _i122 < _list121.size; ++_i122) { - TColumn _elem115; // optional - _elem115 = new TColumn(); - _elem115.read(iprot); - struct.columns.add(_elem115); + TColumn _elem123; // required + _elem123 = new TColumn(); + _elem123.read(iprot); + struct.columns.add(_elem123); } iprot.readListEnd(); } @@ -600,9 +600,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) th oprot.writeFieldBegin(ROWS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); - for (TRow _iter116 : struct.rows) + for (TRow _iter124 : struct.rows) { - _iter116.write(oprot); + _iter124.write(oprot); } oprot.writeListEnd(); } @@ -613,9 +613,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) th oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); - for (TColumn _iter117 : struct.columns) + for (TColumn _iter125 : struct.columns) { - _iter117.write(oprot); + _iter125.write(oprot); } oprot.writeListEnd(); } @@ -642,9 +642,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thr oprot.writeI64(struct.startRowOffset); { oprot.writeI32(struct.rows.size()); - for (TRow _iter118 : struct.rows) + for (TRow _iter126 : struct.rows) { - _iter118.write(oprot); + _iter126.write(oprot); } } BitSet optionals = new BitSet(); @@ -655,9 +655,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thr if (struct.isSetColumns()) { { oprot.writeI32(struct.columns.size()); - for (TColumn _iter119 : struct.columns) + for (TColumn _iter127 : struct.columns) { - _iter119.write(oprot); + _iter127.write(oprot); } } } @@ -669,28 +669,28 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thro struct.startRowOffset = iprot.readI64(); struct.setStartRowOffsetIsSet(true); { - org.apache.thrift.protocol.TList _list120 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.rows = new ArrayList(_list120.size); - for (int _i121 = 0; _i121 < _list120.size; ++_i121) + org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.rows = new ArrayList(_list128.size); + for (int _i129 = 0; _i129 < _list128.size; ++_i129) { - TRow _elem122; // optional - _elem122 = new TRow(); - _elem122.read(iprot); - struct.rows.add(_elem122); + TRow _elem130; // required + _elem130 = new TRow(); + _elem130.read(iprot); + struct.rows.add(_elem130); } } struct.setRowsIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list123 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list123.size); - for (int _i124 = 0; _i124 < _list123.size; ++_i124) + org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list131.size); + for (int _i132 = 0; _i132 < _list131.size; ++_i132) { - TColumn _elem125; // optional - _elem125 = new TColumn(); - _elem125.read(iprot); - struct.columns.add(_elem125); + TColumn _elem133; // required + _elem133 = new TColumn(); + _elem133.read(iprot); + struct.columns.add(_elem133); } } struct.setColumnsIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java index 81c2f16..cb5010f 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java @@ -694,13 +694,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) thr case 2: // INFO_MESSAGES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list126 = iprot.readListBegin(); - struct.infoMessages = new ArrayList(_list126.size); - for (int _i127 = 0; _i127 < _list126.size; ++_i127) + org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); + struct.infoMessages = new ArrayList(_list134.size); + for (int _i135 = 0; _i135 < _list134.size; ++_i135) { - String _elem128; // optional - _elem128 = iprot.readString(); - struct.infoMessages.add(_elem128); + String _elem136; // required + _elem136 = iprot.readString(); + struct.infoMessages.add(_elem136); } iprot.readListEnd(); } @@ -756,9 +756,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) th oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); - for (String _iter129 : struct.infoMessages) + for (String _iter137 : struct.infoMessages) { - oprot.writeString(_iter129); + oprot.writeString(_iter137); } oprot.writeListEnd(); } @@ -819,9 +819,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thr if (struct.isSetInfoMessages()) { { oprot.writeI32(struct.infoMessages.size()); - for (String _iter130 : struct.infoMessages) + for (String _iter138 : struct.infoMessages) { - oprot.writeString(_iter130); + oprot.writeString(_iter138); } } } @@ -844,13 +844,13 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thro BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.infoMessages = new ArrayList(_list131.size); - for (int _i132 = 0; _i132 < _list131.size; ++_i132) + org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.infoMessages = new ArrayList(_list139.size); + for (int _i140 = 0; _i140 < _list139.size; ++_i140) { - String _elem133; // optional - _elem133 = iprot.readString(); - struct.infoMessages.add(_elem133); + String _elem141; // required + _elem141 = iprot.readString(); + struct.infoMessages.add(_elem141); } } struct.setInfoMessagesIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java index ff5e54d..e2882c2 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java @@ -354,7 +354,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema struct struct.columns = new ArrayList(_list38.size); for (int _i39 = 0; _i39 < _list38.size; ++_i39) { - TColumnDesc _elem40; // optional + TColumnDesc _elem40; // required _elem40 = new TColumnDesc(); _elem40.read(iprot); struct.columns.add(_elem40); @@ -425,7 +425,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) struct.columns = new ArrayList(_list43.size); for (int _i44 = 0; _i44 < _list43.size; ++_i44) { - TColumnDesc _elem45; // optional + TColumnDesc _elem45; // required _elem45 = new TColumnDesc(); _elem45.read(iprot); struct.columns.add(_elem45); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java index 251f86a..d6a6d23 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java @@ -354,7 +354,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc struct) t struct.types = new ArrayList(_list30.size); for (int _i31 = 0; _i31 < _list30.size; ++_i31) { - TTypeEntry _elem32; // optional + TTypeEntry _elem32; // required _elem32 = new TTypeEntry(); _elem32.read(iprot); struct.types.add(_elem32); @@ -425,7 +425,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) th struct.types = new ArrayList(_list35.size); for (int _i36 = 0; _i36 < _list35.size; ++_i36) { - TTypeEntry _elem37; // optional + TTypeEntry _elem37; // required _elem37 = new TTypeEntry(); _elem37.read(iprot); struct.types.add(_elem37); diff --git service/src/gen/thrift/gen-py/TCLIService/TCLIService-remote service/src/gen/thrift/gen-py/TCLIService/TCLIService-remote old mode 100644 new mode 100755 diff --git service/src/gen/thrift/gen-py/TCLIService/ttypes.py service/src/gen/thrift/gen-py/TCLIService/ttypes.py index b286b05..be7a1ef 100644 --- service/src/gen/thrift/gen-py/TCLIService/ttypes.py +++ service/src/gen/thrift/gen-py/TCLIService/ttypes.py @@ -1719,6 +1719,66 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +class TBinaryValue: + """ + Attributes: + - value + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'value', None, None, ), # 1 + ) + + def __init__(self, value=None,): + self.value = value + + 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.value = 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('TBinaryValue') + if self.value is not None: + oprot.writeFieldBegin('value', TType.STRING, 1) + oprot.writeString(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + 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 TColumn: """ Attributes: @@ -1729,6 +1789,7 @@ class TColumn: - i64Column - doubleColumn - stringColumn + - binaryColumn """ thrift_spec = ( @@ -1740,9 +1801,10 @@ class TColumn: (5, TType.LIST, 'i64Column', (TType.STRUCT,(TI64Value, TI64Value.thrift_spec)), None, ), # 5 (6, TType.LIST, 'doubleColumn', (TType.STRUCT,(TDoubleValue, TDoubleValue.thrift_spec)), None, ), # 6 (7, TType.LIST, 'stringColumn', (TType.STRUCT,(TStringValue, TStringValue.thrift_spec)), None, ), # 7 + (8, TType.LIST, 'binaryColumn', (TType.STRUCT,(TBinaryValue, TBinaryValue.thrift_spec)), None, ), # 8 ) - def __init__(self, boolColumn=None, byteColumn=None, i16Column=None, i32Column=None, i64Column=None, doubleColumn=None, stringColumn=None,): + def __init__(self, boolColumn=None, byteColumn=None, i16Column=None, i32Column=None, i64Column=None, doubleColumn=None, stringColumn=None, binaryColumn=None,): self.boolColumn = boolColumn self.byteColumn = byteColumn self.i16Column = i16Column @@ -1750,6 +1812,7 @@ def __init__(self, boolColumn=None, byteColumn=None, i16Column=None, i32Column=N self.i64Column = i64Column self.doubleColumn = doubleColumn self.stringColumn = stringColumn + self.binaryColumn = binaryColumn 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: @@ -1837,6 +1900,17 @@ def read(self, iprot): iprot.readListEnd() else: iprot.skip(ftype) + elif fid == 8: + if ftype == TType.LIST: + self.binaryColumn = [] + (_etype86, _size83) = iprot.readListBegin() + for _i87 in xrange(_size83): + _elem88 = TBinaryValue() + _elem88.read(iprot) + self.binaryColumn.append(_elem88) + iprot.readListEnd() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -1850,50 +1924,57 @@ def write(self, oprot): if self.boolColumn is not None: oprot.writeFieldBegin('boolColumn', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.boolColumn)) - for iter83 in self.boolColumn: - iter83.write(oprot) + for iter89 in self.boolColumn: + iter89.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.byteColumn is not None: oprot.writeFieldBegin('byteColumn', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.byteColumn)) - for iter84 in self.byteColumn: - iter84.write(oprot) + for iter90 in self.byteColumn: + iter90.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.i16Column is not None: oprot.writeFieldBegin('i16Column', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.i16Column)) - for iter85 in self.i16Column: - iter85.write(oprot) + for iter91 in self.i16Column: + iter91.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.i32Column is not None: oprot.writeFieldBegin('i32Column', TType.LIST, 4) oprot.writeListBegin(TType.STRUCT, len(self.i32Column)) - for iter86 in self.i32Column: - iter86.write(oprot) + for iter92 in self.i32Column: + iter92.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.i64Column is not None: oprot.writeFieldBegin('i64Column', TType.LIST, 5) oprot.writeListBegin(TType.STRUCT, len(self.i64Column)) - for iter87 in self.i64Column: - iter87.write(oprot) + for iter93 in self.i64Column: + iter93.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.doubleColumn is not None: oprot.writeFieldBegin('doubleColumn', TType.LIST, 6) oprot.writeListBegin(TType.STRUCT, len(self.doubleColumn)) - for iter88 in self.doubleColumn: - iter88.write(oprot) + for iter94 in self.doubleColumn: + iter94.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.stringColumn is not None: oprot.writeFieldBegin('stringColumn', TType.LIST, 7) oprot.writeListBegin(TType.STRUCT, len(self.stringColumn)) - for iter89 in self.stringColumn: - iter89.write(oprot) + for iter95 in self.stringColumn: + iter95.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.binaryColumn is not None: + oprot.writeFieldBegin('binaryColumn', TType.LIST, 8) + oprot.writeListBegin(TType.STRUCT, len(self.binaryColumn)) + for iter96 in self.binaryColumn: + iter96.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -1924,6 +2005,7 @@ class TColumnValue: - i64Val - doubleVal - stringVal + - binaryVal """ thrift_spec = ( @@ -1935,9 +2017,10 @@ class TColumnValue: (5, TType.STRUCT, 'i64Val', (TI64Value, TI64Value.thrift_spec), None, ), # 5 (6, TType.STRUCT, 'doubleVal', (TDoubleValue, TDoubleValue.thrift_spec), None, ), # 6 (7, TType.STRUCT, 'stringVal', (TStringValue, TStringValue.thrift_spec), None, ), # 7 + (8, TType.STRUCT, 'binaryVal', (TBinaryValue, TBinaryValue.thrift_spec), None, ), # 8 ) - def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None,): + def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None, binaryVal=None,): self.boolVal = boolVal self.byteVal = byteVal self.i16Val = i16Val @@ -1945,6 +2028,7 @@ def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val= self.i64Val = i64Val self.doubleVal = doubleVal self.stringVal = stringVal + self.binaryVal = binaryVal 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: @@ -1997,6 +2081,12 @@ def read(self, iprot): self.stringVal.read(iprot) else: iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRUCT: + self.binaryVal = TBinaryValue() + self.binaryVal.read(iprot) + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -2035,6 +2125,10 @@ def write(self, oprot): oprot.writeFieldBegin('stringVal', TType.STRUCT, 7) self.stringVal.write(oprot) oprot.writeFieldEnd() + if self.binaryVal is not None: + oprot.writeFieldBegin('binaryVal', TType.STRUCT, 8) + self.binaryVal.write(oprot) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2079,11 +2173,11 @@ def read(self, iprot): if fid == 1: if ftype == TType.LIST: self.colVals = [] - (_etype93, _size90) = iprot.readListBegin() - for _i94 in xrange(_size90): - _elem95 = TColumnValue() - _elem95.read(iprot) - self.colVals.append(_elem95) + (_etype100, _size97) = iprot.readListBegin() + for _i101 in xrange(_size97): + _elem102 = TColumnValue() + _elem102.read(iprot) + self.colVals.append(_elem102) iprot.readListEnd() else: iprot.skip(ftype) @@ -2100,8 +2194,8 @@ def write(self, oprot): if self.colVals is not None: oprot.writeFieldBegin('colVals', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.colVals)) - for iter96 in self.colVals: - iter96.write(oprot) + for iter103 in self.colVals: + iter103.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2161,22 +2255,22 @@ def read(self, iprot): elif fid == 2: if ftype == TType.LIST: self.rows = [] - (_etype100, _size97) = iprot.readListBegin() - for _i101 in xrange(_size97): - _elem102 = TRow() - _elem102.read(iprot) - self.rows.append(_elem102) + (_etype107, _size104) = iprot.readListBegin() + for _i108 in xrange(_size104): + _elem109 = TRow() + _elem109.read(iprot) + self.rows.append(_elem109) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.columns = [] - (_etype106, _size103) = iprot.readListBegin() - for _i107 in xrange(_size103): - _elem108 = TColumn() - _elem108.read(iprot) - self.columns.append(_elem108) + (_etype113, _size110) = iprot.readListBegin() + for _i114 in xrange(_size110): + _elem115 = TColumn() + _elem115.read(iprot) + self.columns.append(_elem115) iprot.readListEnd() else: iprot.skip(ftype) @@ -2197,15 +2291,15 @@ def write(self, oprot): if self.rows is not None: oprot.writeFieldBegin('rows', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.rows)) - for iter109 in self.rows: - iter109.write(oprot) + for iter116 in self.rows: + iter116.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.columns)) - for iter110 in self.columns: - iter110.write(oprot) + for iter117 in self.columns: + iter117.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2273,10 +2367,10 @@ def read(self, iprot): elif fid == 2: if ftype == TType.LIST: self.infoMessages = [] - (_etype114, _size111) = iprot.readListBegin() - for _i115 in xrange(_size111): - _elem116 = iprot.readString(); - self.infoMessages.append(_elem116) + (_etype121, _size118) = iprot.readListBegin() + for _i122 in xrange(_size118): + _elem123 = iprot.readString(); + self.infoMessages.append(_elem123) iprot.readListEnd() else: iprot.skip(ftype) @@ -2312,8 +2406,8 @@ def write(self, oprot): if self.infoMessages is not None: oprot.writeFieldBegin('infoMessages', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.infoMessages)) - for iter117 in self.infoMessages: - oprot.writeString(iter117) + for iter124 in self.infoMessages: + oprot.writeString(iter124) oprot.writeListEnd() oprot.writeFieldEnd() if self.sqlState is not None: @@ -2640,11 +2734,11 @@ def read(self, iprot): elif fid == 4: if ftype == TType.MAP: self.configuration = {} - (_ktype119, _vtype120, _size118 ) = iprot.readMapBegin() - for _i122 in xrange(_size118): - _key123 = iprot.readString(); - _val124 = iprot.readString(); - self.configuration[_key123] = _val124 + (_ktype126, _vtype127, _size125 ) = iprot.readMapBegin() + for _i129 in xrange(_size125): + _key130 = iprot.readString(); + _val131 = iprot.readString(); + self.configuration[_key130] = _val131 iprot.readMapEnd() else: iprot.skip(ftype) @@ -2673,9 +2767,9 @@ def write(self, oprot): if self.configuration is not None: oprot.writeFieldBegin('configuration', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) - for kiter125,viter126 in self.configuration.items(): - oprot.writeString(kiter125) - oprot.writeString(viter126) + for kiter132,viter133 in self.configuration.items(): + oprot.writeString(kiter132) + oprot.writeString(viter133) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2750,11 +2844,11 @@ def read(self, iprot): elif fid == 4: if ftype == TType.MAP: self.configuration = {} - (_ktype128, _vtype129, _size127 ) = iprot.readMapBegin() - for _i131 in xrange(_size127): - _key132 = iprot.readString(); - _val133 = iprot.readString(); - self.configuration[_key132] = _val133 + (_ktype135, _vtype136, _size134 ) = iprot.readMapBegin() + for _i138 in xrange(_size134): + _key139 = iprot.readString(); + _val140 = iprot.readString(); + self.configuration[_key139] = _val140 iprot.readMapEnd() else: iprot.skip(ftype) @@ -2783,9 +2877,9 @@ def write(self, oprot): if self.configuration is not None: oprot.writeFieldBegin('configuration', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) - for kiter134,viter135 in self.configuration.items(): - oprot.writeString(kiter134) - oprot.writeString(viter135) + for kiter141,viter142 in self.configuration.items(): + oprot.writeString(kiter141) + oprot.writeString(viter142) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -3257,11 +3351,11 @@ def read(self, iprot): elif fid == 3: if ftype == TType.MAP: self.confOverlay = {} - (_ktype137, _vtype138, _size136 ) = iprot.readMapBegin() - for _i140 in xrange(_size136): - _key141 = iprot.readString(); - _val142 = iprot.readString(); - self.confOverlay[_key141] = _val142 + (_ktype144, _vtype145, _size143 ) = iprot.readMapBegin() + for _i147 in xrange(_size143): + _key148 = iprot.readString(); + _val149 = iprot.readString(); + self.confOverlay[_key148] = _val149 iprot.readMapEnd() else: iprot.skip(ftype) @@ -3291,9 +3385,9 @@ def write(self, oprot): if self.confOverlay is not None: oprot.writeFieldBegin('confOverlay', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.confOverlay)) - for kiter143,viter144 in self.confOverlay.items(): - oprot.writeString(kiter143) - oprot.writeString(viter144) + for kiter150,viter151 in self.confOverlay.items(): + oprot.writeString(kiter150) + oprot.writeString(viter151) oprot.writeMapEnd() oprot.writeFieldEnd() if self.runAsync is not None: @@ -3898,10 +3992,10 @@ def read(self, iprot): elif fid == 5: if ftype == TType.LIST: self.tableTypes = [] - (_etype148, _size145) = iprot.readListBegin() - for _i149 in xrange(_size145): - _elem150 = iprot.readString(); - self.tableTypes.append(_elem150) + (_etype155, _size152) = iprot.readListBegin() + for _i156 in xrange(_size152): + _elem157 = iprot.readString(); + self.tableTypes.append(_elem157) iprot.readListEnd() else: iprot.skip(ftype) @@ -3934,8 +4028,8 @@ def write(self, oprot): if self.tableTypes is not None: oprot.writeFieldBegin('tableTypes', TType.LIST, 5) oprot.writeListBegin(TType.STRING, len(self.tableTypes)) - for iter151 in self.tableTypes: - oprot.writeString(iter151) + for iter158 in self.tableTypes: + oprot.writeString(iter158) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() diff --git service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote service/src/gen/thrift/gen-py/hive_service/ThriftHive-remote old mode 100644 new mode 100755 diff --git service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb index c608364..d8c0da1 100644 --- service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb +++ service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb @@ -518,6 +518,22 @@ class TStringValue ::Thrift::Struct.generate_accessors self end +class TBinaryValue + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + class TColumn < ::Thrift::Union include ::Thrift::Struct_Union class << self @@ -548,6 +564,10 @@ class TColumn < ::Thrift::Union def stringColumn(val) TColumn.new(:stringColumn, val) end + + def binaryColumn(val) + TColumn.new(:binaryColumn, val) + end end BOOLCOLUMN = 1 @@ -557,6 +577,7 @@ class TColumn < ::Thrift::Union I64COLUMN = 5 DOUBLECOLUMN = 6 STRINGCOLUMN = 7 + BINARYCOLUMN = 8 FIELDS = { BOOLCOLUMN => {:type => ::Thrift::Types::LIST, :name => 'boolColumn', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TBoolValue}}, @@ -565,7 +586,8 @@ class TColumn < ::Thrift::Union I32COLUMN => {:type => ::Thrift::Types::LIST, :name => 'i32Column', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TI32Value}}, I64COLUMN => {:type => ::Thrift::Types::LIST, :name => 'i64Column', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TI64Value}}, DOUBLECOLUMN => {:type => ::Thrift::Types::LIST, :name => 'doubleColumn', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TDoubleValue}}, - STRINGCOLUMN => {:type => ::Thrift::Types::LIST, :name => 'stringColumn', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TStringValue}} + STRINGCOLUMN => {:type => ::Thrift::Types::LIST, :name => 'stringColumn', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TStringValue}}, + BINARYCOLUMN => {:type => ::Thrift::Types::LIST, :name => 'binaryColumn', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TBinaryValue}} } def struct_fields; FIELDS; end @@ -607,6 +629,10 @@ class TColumnValue < ::Thrift::Union def stringVal(val) TColumnValue.new(:stringVal, val) end + + def binaryVal(val) + TColumnValue.new(:binaryVal, val) + end end BOOLVAL = 1 @@ -616,6 +642,7 @@ class TColumnValue < ::Thrift::Union I64VAL = 5 DOUBLEVAL = 6 STRINGVAL = 7 + BINARYVAL = 8 FIELDS = { BOOLVAL => {:type => ::Thrift::Types::STRUCT, :name => 'boolVal', :class => ::TBoolValue}, @@ -624,7 +651,8 @@ class TColumnValue < ::Thrift::Union I32VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i32Val', :class => ::TI32Value}, I64VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i64Val', :class => ::TI64Value}, DOUBLEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'doubleVal', :class => ::TDoubleValue}, - STRINGVAL => {:type => ::Thrift::Types::STRUCT, :name => 'stringVal', :class => ::TStringValue} + STRINGVAL => {:type => ::Thrift::Types::STRUCT, :name => 'stringVal', :class => ::TStringValue}, + BINARYVAL => {:type => ::Thrift::Types::STRUCT, :name => 'binaryVal', :class => ::TBinaryValue} } def struct_fields; FIELDS; end diff --git service/src/java/org/apache/hive/service/cli/ColumnValue.java service/src/java/org/apache/hive/service/cli/ColumnValue.java index 905ba01..8080c63 100644 --- service/src/java/org/apache/hive/service/cli/ColumnValue.java +++ service/src/java/org/apache/hive/service/cli/ColumnValue.java @@ -23,6 +23,7 @@ import org.apache.hadoop.hive.common.type.HiveDecimal; import org.apache.hadoop.hive.common.type.HiveVarchar; +import org.apache.hive.service.cli.thrift.TBinaryValue; import org.apache.hive.service.cli.thrift.TBoolValue; import org.apache.hive.service.cli.thrift.TByteValue; import org.apache.hive.service.cli.thrift.TColumnValue; @@ -146,11 +147,19 @@ public static ColumnValue timestampValue(Timestamp value) { public static ColumnValue stringValue(HiveDecimal value) { TStringValue tStrValue = new TStringValue(); if (value != null) { - tStrValue.setValue(((HiveDecimal)value).toString()); + tStrValue.setValue(value.toString()); } return new ColumnValue(TColumnValue.stringVal(tStrValue)); } + public static ColumnValue binaryValue(byte[] value) { + TBinaryValue tBinaryValue = new TBinaryValue(); + if (value != null) { + tBinaryValue.setValue(value); + } + return new ColumnValue(TColumnValue.binaryVal(tBinaryValue)); + } + public static ColumnValue newColumnValue(Type type, Object value) { switch (type) { case BOOLEAN_TYPE: @@ -178,6 +187,7 @@ public static ColumnValue newColumnValue(Type type, Object value) { case DECIMAL_TYPE: return stringValue(((HiveDecimal)value)); case BINARY_TYPE: + return binaryValue(((byte[]) value)); case ARRAY_TYPE: case MAP_TYPE: case STRUCT_TYPE: diff --git service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java index f6adf92..cb31316 100644 --- service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java @@ -252,20 +252,15 @@ public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws H * This method is kept consistent with {@link HiveResultSetMetaData#hiveTypeToSqlType}. */ private static Object convertLazyToJava(Object o, ObjectInspector oi) { - Object obj = ObjectInspectorUtils.copyToStandardObject(o, oi, ObjectInspectorCopyOption.JAVA); - - if (obj == null) { + if (o == null) { return null; } - if(oi.getTypeName().equals(serdeConstants.BINARY_TYPE_NAME)) { - return new String((byte[])obj); + if (oi.getCategory() == ObjectInspector.Category.PRIMITIVE) { + return ObjectInspectorUtils.copyToStandardObject(o, oi, ObjectInspectorCopyOption.JAVA); } // for now, expose non-primitive as a string // TODO: expose non-primitive as a structured object while maintaining JDBC compliance - if (oi.getCategory() != ObjectInspector.Category.PRIMITIVE) { - return SerDeUtils.getJSONString(o, oi); - } - return obj; + return SerDeUtils.getJSONString(o, oi); }