diff --git itests/hive-unit/src/test/java/org/apache/hive/jdbc/miniHS2/TestHiveServer2.java itests/hive-unit/src/test/java/org/apache/hive/jdbc/miniHS2/TestHiveServer2.java index eb08628..f3ea07c 100644 --- itests/hive-unit/src/test/java/org/apache/hive/jdbc/miniHS2/TestHiveServer2.java +++ itests/hive-unit/src/test/java/org/apache/hive/jdbc/miniHS2/TestHiveServer2.java @@ -64,6 +64,6 @@ public void testConnection() throws Exception { serviceClient.executeStatement(sessHandle, "CREATE TABLE " + tabName + " (id INT)", confOverlay); OperationHandle opHandle = serviceClient.executeStatement(sessHandle, "SHOW TABLES", confOverlay); RowSet rowSet = serviceClient.fetchResults(opHandle); - assertFalse(rowSet.getSize() == 0); + assertFalse(rowSet.numRows() == 0); } } diff --git jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java index b02f374..3ddd1f6 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java @@ -42,17 +42,9 @@ import java.util.List; import java.util.Map; +import org.apache.hive.service.cli.RowSet; import org.apache.hive.service.cli.TableSchema; import org.apache.hive.service.cli.Type; -import org.apache.hive.service.cli.thrift.TBoolValue; -import org.apache.hive.service.cli.thrift.TByteValue; -import org.apache.hive.service.cli.thrift.TColumnValue; -import org.apache.hive.service.cli.thrift.TDoubleValue; -import org.apache.hive.service.cli.thrift.TI16Value; -import org.apache.hive.service.cli.thrift.TI32Value; -import org.apache.hive.service.cli.thrift.TI64Value; -import org.apache.hive.service.cli.thrift.TRow; -import org.apache.hive.service.cli.thrift.TStringValue; /** * Data independent base class which implements the common part of @@ -62,7 +54,7 @@ protected Statement statement = null; protected SQLWarning warningChain = null; protected boolean wasNull = false; - protected TRow row; + protected Object[] row; protected List columnNames; protected List columnTypes; protected List columnAttributes; @@ -380,176 +372,25 @@ public String getNString(String columnLabel) throws SQLException { throw new SQLException("Method not supported"); } - private Boolean getBooleanValue(TBoolValue tBoolValue) { - if (tBoolValue.isSetValue()) { - wasNull = false; - return tBoolValue.isValue(); - } - wasNull = true; - return null; - } - - private Byte getByteValue(TByteValue tByteValue) { - if (tByteValue.isSetValue()) { - wasNull = false; - return tByteValue.getValue(); - } - wasNull = true; - return null; - } - - private Short getShortValue(TI16Value tI16Value) { - if (tI16Value.isSetValue()) { - wasNull = false; - return tI16Value.getValue(); - } - wasNull = true; - return null; - } - - private Integer getIntegerValue(TI32Value tI32Value) { - if (tI32Value.isSetValue()) { - wasNull = false; - return tI32Value.getValue(); - } - wasNull = true; - return null; - } - - private Long getLongValue(TI64Value tI64Value) { - if (tI64Value.isSetValue()) { - wasNull = false; - return tI64Value.getValue(); - } - wasNull = true; - return null; - } - - private Double getDoubleValue(TDoubleValue tDoubleValue) { - if (tDoubleValue.isSetValue()) { - wasNull = false; - return tDoubleValue.getValue(); - } - wasNull = true; - return null; - } - - private String getStringValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - wasNull = false; - return tStringValue.getValue(); - } - wasNull = true; - return null; - } - - private Date getDateValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - wasNull = false; - return Date.valueOf(tStringValue.getValue()); - } - wasNull = true; - return null; - } - - private Timestamp getTimestampValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - wasNull = false; - return Timestamp.valueOf(tStringValue.getValue()); - } - wasNull = true; - return null; - } - - private byte[] getBinaryValue(TStringValue tString) { - if (tString.isSetValue()) { - wasNull = false; - return tString.getValue().getBytes(); - } - wasNull = true; - return null; - } - - private BigDecimal getBigDecimalValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - wasNull = false; - return new BigDecimal(tStringValue.getValue()); - } - wasNull = true; - return null; - } - private Object getColumnValue(int columnIndex) throws SQLException { if (row == null) { throw new SQLException("No row found."); } - List colVals = row.getColVals(); - if (colVals == null) { + if (row == null) { throw new SQLException("RowSet does not contain any columns!"); } - if (columnIndex > colVals.size()) { + if (columnIndex > row.length) { throw new SQLException("Invalid columnIndex: " + columnIndex); } - - TColumnValue tColumnValue = colVals.get(columnIndex - 1); Type columnType = getSchema().getColumnDescriptorAt(columnIndex - 1).getType(); - switch (columnType) { - case BOOLEAN_TYPE: - return getBooleanValue(tColumnValue.getBoolVal()); - case TINYINT_TYPE: - return getByteValue(tColumnValue.getByteVal()); - case SMALLINT_TYPE: - return getShortValue(tColumnValue.getI16Val()); - case INT_TYPE: - return getIntegerValue(tColumnValue.getI32Val()); - case BIGINT_TYPE: - return getLongValue(tColumnValue.getI64Val()); - case FLOAT_TYPE: - return getDoubleValue(tColumnValue.getDoubleVal()); - case DOUBLE_TYPE: - return getDoubleValue(tColumnValue.getDoubleVal()); - case STRING_TYPE: - return getStringValue(tColumnValue.getStringVal()); - case CHAR_TYPE: - return getStringValue(tColumnValue.getStringVal()); - case VARCHAR_TYPE: - return getStringValue(tColumnValue.getStringVal()); - case BINARY_TYPE: - return getBinaryValue(tColumnValue.getStringVal()); - case DATE_TYPE: - return getDateValue(tColumnValue.getStringVal()); - case TIMESTAMP_TYPE: - return getTimestampValue(tColumnValue.getStringVal()); - case DECIMAL_TYPE: - return getBigDecimalValue(tColumnValue.getStringVal()); - case NULL_TYPE: - wasNull = true; - return null; - default: + try { + Object evaluated = RowSet.evaluate(columnType, row[columnIndex - 1]); + wasNull = evaluated == null; + return evaluated; + } catch (Exception e) { throw new SQLException("Unrecognized column type:" + columnType); } - - /* - switch (tColumnValue.getSetField()) { - case BOOL_VAL: - return getBooleanValue(tColumnValue.getBoolVal()); - case BYTE_VAL: - return getByteValue(tColumnValue.getByteVal()); - case I16_VAL: - return getShortValue(tColumnValue.getI16Val()); - case I32_VAL: - return getIntegerValue(tColumnValue.getI32Val()); - case I64_VAL: - return getLongValue(tColumnValue.getI64Val()); - case DOUBLE_VAL: - return getDoubleValue(tColumnValue.getDoubleVal()); - case STRING_VAL: - return getStringValue(tColumnValue.getStringVal()); - default: - throw new SQLException("Unrecognized column type:" + tColumnValue.getSetField()); - } - */ } public Object getObject(int columnIndex) throws SQLException { diff --git jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java index 812ee56..336af6a 100644 --- jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java +++ jdbc/src/java/org/apache/hive/jdbc/HiveQueryResultSet.java @@ -30,6 +30,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hive.common.type.HiveDecimal; +import org.apache.hive.service.cli.RowSet; import org.apache.hive.service.cli.TableSchema; import org.apache.hive.service.cli.thrift.TCLIService; import org.apache.hive.service.cli.thrift.TCLIServiceConstants; @@ -41,7 +42,6 @@ import org.apache.hive.service.cli.thrift.TGetResultSetMetadataResp; import org.apache.hive.service.cli.thrift.TOperationHandle; import org.apache.hive.service.cli.thrift.TPrimitiveTypeEntry; -import org.apache.hive.service.cli.thrift.TRow; import org.apache.hive.service.cli.thrift.TSessionHandle; import org.apache.hive.service.cli.thrift.TTableSchema; import org.apache.hive.service.cli.thrift.TTypeQualifierValue; @@ -62,8 +62,8 @@ private int fetchSize; private int rowsFetched = 0; - private List fetchedRows; - private Iterator fetchedRowsItr; + private RowSet fetchedRows; + private Iterator fetchedRowsItr; private boolean isClosed = false; private boolean emptyResultSet = false; @@ -291,7 +291,7 @@ public boolean next() throws SQLException { TFetchOrientation.FETCH_NEXT, fetchSize); TFetchResultsResp fetchResp = client.FetchResults(fetchReq); Utils.verifySuccessWithInfo(fetchResp.getStatus()); - fetchedRows = fetchResp.getResults().getRows(); + fetchedRows = new RowSet(fetchResp.getResults()); fetchedRowsItr = fetchedRows.iterator(); } 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 service/if/TCLIService.thrift service/if/TCLIService.thrift index 62a9730..fb8cb50 100644 --- service/if/TCLIService.thrift +++ service/if/TCLIService.thrift @@ -85,9 +85,9 @@ const set PRIMITIVE_TYPES = [ TTypeId.TIMESTAMP_TYPE, TTypeId.BINARY_TYPE, TTypeId.DECIMAL_TYPE, - TTypeId.NULL_TYPE - TTypeId.DATE_TYPE - TTypeId.VARCHAR_TYPE + TTypeId.NULL_TYPE, + TTypeId.DATE_TYPE, + TTypeId.VARCHAR_TYPE, TTypeId.CHAR_TYPE ] @@ -262,56 +262,50 @@ struct TTableSchema { // A Boolean column value. struct TBoolValue { - // NULL if value is unset. - 1: optional bool value + 1: required list values + 2: required binary nulls } // A Byte column value. struct TByteValue { - // NULL if value is unset. - 1: optional byte value + 1: required list values + 2: required binary nulls } // A signed, 16 bit column value. struct TI16Value { - // NULL if value is unset - 1: optional i16 value + 1: required list values + 2: required binary nulls } // A signed, 32 bit column value struct TI32Value { - // NULL if value is unset - 1: optional i32 value + 1: required list values + 2: required binary nulls } // A signed 64 bit column value struct TI64Value { - // NULL if value is unset - 1: optional i64 value + 1: required list values + 2: required binary nulls } // A floating point 64 bit column value struct TDoubleValue { - // NULL if value is unset - 1: optional double value + 1: required list values + 2: required binary nulls } struct TStringValue { - // NULL if value is unset - 1: optional string value + 1: required list values + 2: required binary nulls } -union TColumn { - 1: list boolColumn - 2: list byteColumn - 3: list i16Column - 4: list i32Column - 5: list i64Column - 6: list doubleColumn - 7: list stringColumn +struct TBinaryValue { + 1: required list values + 2: required binary nulls } -// A single column value in a result set. // Note that Hive's type system is richer than Thrift's, // so in some cases we have to map multiple Hive types // to the same Thrift type. On the client-side this is @@ -324,20 +318,15 @@ 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 -} - -// Represents a row in a rowset. -struct TRow { - 1: required list colVals + 7: TStringValue stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, DECIMAL, NULL + 8: TBinaryValue binaryVal // BINARY } // Represents a rowset struct TRowSet { // The starting row offset of this rowset. 1: required i64 startRowOffset - 2: required list rows - 3: optional list columns + 2: required list colVals } // The return status code contained in each response. diff --git service/src/gen/thrift/gen-cpp/TCLIService_types.cpp service/src/gen/thrift/gen-cpp/TCLIService_types.cpp index 7ab1310..c8eb43a 100644 --- service/src/gen/thrift/gen-cpp/TCLIService_types.cpp +++ service/src/gen/thrift/gen-cpp/TCLIService_types.cpp @@ -1286,8 +1286,8 @@ void swap(TTableSchema &a, TTableSchema &b) { swap(a.columns, b.columns); } -const char* TBoolValue::ascii_fingerprint = "BF054652DEF86253C2BEE7D947F167DD"; -const uint8_t TBoolValue::binary_fingerprint[16] = {0xBF,0x05,0x46,0x52,0xDE,0xF8,0x62,0x53,0xC2,0xBE,0xE7,0xD9,0x47,0xF1,0x67,0xDD}; +const char* TBoolValue::ascii_fingerprint = "F9058324D96DB7F974D8ACDC01C54219"; +const uint8_t TBoolValue::binary_fingerprint[16] = {0xF9,0x05,0x83,0x24,0xD9,0x6D,0xB7,0xF9,0x74,0xD8,0xAC,0xDC,0x01,0xC5,0x42,0x19}; uint32_t TBoolValue::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1300,6 +1300,8 @@ uint32_t TBoolValue::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1310,9 +1312,29 @@ uint32_t TBoolValue::read(::apache::thrift::protocol::TProtocol* iprot) { switch (fid) { case 1: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->value); - this->__isset.value = true; + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size37; + ::apache::thrift::protocol::TType _etype40; + xfer += iprot->readListBegin(_etype40, _size37); + this->values.resize(_size37); + uint32_t _i41; + for (_i41 = 0; _i41 < _size37; ++_i41) + { + xfer += iprot->readBool(this->values[_i41]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1326,6 +1348,10 @@ uint32_t TBoolValue::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1333,11 +1359,22 @@ uint32_t TBoolValue::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("TBoolValue"); - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_BOOL, 1); - xfer += oprot->writeBool(this->value); - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_BOOL, static_cast(this->values.size())); + std::vector ::const_iterator _iter42; + for (_iter42 = this->values.begin(); _iter42 != this->values.end(); ++_iter42) + { + xfer += oprot->writeBool((*_iter42)); + } + xfer += oprot->writeListEnd(); } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1345,12 +1382,12 @@ uint32_t TBoolValue::write(::apache::thrift::protocol::TProtocol* oprot) const { void swap(TBoolValue &a, TBoolValue &b) { using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -const char* TByteValue::ascii_fingerprint = "9C15298ACB5D04AEA9B52D5DDE6F9208"; -const uint8_t TByteValue::binary_fingerprint[16] = {0x9C,0x15,0x29,0x8A,0xCB,0x5D,0x04,0xAE,0xA9,0xB5,0x2D,0x5D,0xDE,0x6F,0x92,0x08}; +const char* TByteValue::ascii_fingerprint = "1CB300106BAA463A70BB2A2395900F48"; +const uint8_t TByteValue::binary_fingerprint[16] = {0x1C,0xB3,0x00,0x10,0x6B,0xAA,0x46,0x3A,0x70,0xBB,0x2A,0x23,0x95,0x90,0x0F,0x48}; uint32_t TByteValue::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1363,6 +1400,8 @@ uint32_t TByteValue::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1373,9 +1412,29 @@ uint32_t TByteValue::read(::apache::thrift::protocol::TProtocol* iprot) { switch (fid) { case 1: - if (ftype == ::apache::thrift::protocol::T_BYTE) { - xfer += iprot->readByte(this->value); - this->__isset.value = true; + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size43; + ::apache::thrift::protocol::TType _etype46; + xfer += iprot->readListBegin(_etype46, _size43); + this->values.resize(_size43); + uint32_t _i47; + for (_i47 = 0; _i47 < _size43; ++_i47) + { + xfer += iprot->readByte(this->values[_i47]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1389,6 +1448,10 @@ uint32_t TByteValue::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1396,11 +1459,22 @@ uint32_t TByteValue::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("TByteValue"); - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_BYTE, 1); - xfer += oprot->writeByte(this->value); - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_BYTE, static_cast(this->values.size())); + std::vector ::const_iterator _iter48; + for (_iter48 = this->values.begin(); _iter48 != this->values.end(); ++_iter48) + { + xfer += oprot->writeByte((*_iter48)); + } + xfer += oprot->writeListEnd(); } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1408,12 +1482,12 @@ uint32_t TByteValue::write(::apache::thrift::protocol::TProtocol* oprot) const { void swap(TByteValue &a, TByteValue &b) { using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -const char* TI16Value::ascii_fingerprint = "5DAC9C51C7E1106BF936FC71860BE9D5"; -const uint8_t TI16Value::binary_fingerprint[16] = {0x5D,0xAC,0x9C,0x51,0xC7,0xE1,0x10,0x6B,0xF9,0x36,0xFC,0x71,0x86,0x0B,0xE9,0xD5}; +const char* TI16Value::ascii_fingerprint = "6574CDB1F121C8DB47FB257A3F104BDB"; +const uint8_t TI16Value::binary_fingerprint[16] = {0x65,0x74,0xCD,0xB1,0xF1,0x21,0xC8,0xDB,0x47,0xFB,0x25,0x7A,0x3F,0x10,0x4B,0xDB}; uint32_t TI16Value::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1426,6 +1500,8 @@ uint32_t TI16Value::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1436,9 +1512,29 @@ uint32_t TI16Value::read(::apache::thrift::protocol::TProtocol* iprot) { switch (fid) { case 1: - if (ftype == ::apache::thrift::protocol::T_I16) { - xfer += iprot->readI16(this->value); - this->__isset.value = true; + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size49; + ::apache::thrift::protocol::TType _etype52; + xfer += iprot->readListBegin(_etype52, _size49); + this->values.resize(_size49); + uint32_t _i53; + for (_i53 = 0; _i53 < _size49; ++_i53) + { + xfer += iprot->readI16(this->values[_i53]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1452,6 +1548,10 @@ uint32_t TI16Value::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1459,11 +1559,22 @@ uint32_t TI16Value::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("TI16Value"); - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I16, 1); - xfer += oprot->writeI16(this->value); - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I16, static_cast(this->values.size())); + std::vector ::const_iterator _iter54; + for (_iter54 = this->values.begin(); _iter54 != this->values.end(); ++_iter54) + { + xfer += oprot->writeI16((*_iter54)); + } + xfer += oprot->writeListEnd(); } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1471,12 +1582,12 @@ uint32_t TI16Value::write(::apache::thrift::protocol::TProtocol* oprot) const { void swap(TI16Value &a, TI16Value &b) { using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -const char* TI32Value::ascii_fingerprint = "E7A96B151330359E84C0A3AC91BCBACD"; -const uint8_t TI32Value::binary_fingerprint[16] = {0xE7,0xA9,0x6B,0x15,0x13,0x30,0x35,0x9E,0x84,0xC0,0xA3,0xAC,0x91,0xBC,0xBA,0xCD}; +const char* TI32Value::ascii_fingerprint = "CCCCE89C7E9DA10280F5663700677313"; +const uint8_t TI32Value::binary_fingerprint[16] = {0xCC,0xCC,0xE8,0x9C,0x7E,0x9D,0xA1,0x02,0x80,0xF5,0x66,0x37,0x00,0x67,0x73,0x13}; uint32_t TI32Value::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1489,6 +1600,8 @@ uint32_t TI32Value::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1499,9 +1612,29 @@ uint32_t TI32Value::read(::apache::thrift::protocol::TProtocol* iprot) { switch (fid) { case 1: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->value); - this->__isset.value = true; + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size55; + ::apache::thrift::protocol::TType _etype58; + xfer += iprot->readListBegin(_etype58, _size55); + this->values.resize(_size55); + uint32_t _i59; + for (_i59 = 0; _i59 < _size55; ++_i59) + { + xfer += iprot->readI32(this->values[_i59]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1515,6 +1648,10 @@ uint32_t TI32Value::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1522,11 +1659,22 @@ uint32_t TI32Value::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("TI32Value"); - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32(this->value); - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->values.size())); + std::vector ::const_iterator _iter60; + for (_iter60 = this->values.begin(); _iter60 != this->values.end(); ++_iter60) + { + xfer += oprot->writeI32((*_iter60)); + } + xfer += oprot->writeListEnd(); } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1534,12 +1682,12 @@ uint32_t TI32Value::write(::apache::thrift::protocol::TProtocol* oprot) const { void swap(TI32Value &a, TI32Value &b) { using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -const char* TI64Value::ascii_fingerprint = "148F3AAAC1D9859963D5E800D187BF26"; -const uint8_t TI64Value::binary_fingerprint[16] = {0x14,0x8F,0x3A,0xAA,0xC1,0xD9,0x85,0x99,0x63,0xD5,0xE8,0x00,0xD1,0x87,0xBF,0x26}; +const char* TI64Value::ascii_fingerprint = "925353917FC0AF87976A2338011F5A31"; +const uint8_t TI64Value::binary_fingerprint[16] = {0x92,0x53,0x53,0x91,0x7F,0xC0,0xAF,0x87,0x97,0x6A,0x23,0x38,0x01,0x1F,0x5A,0x31}; uint32_t TI64Value::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1552,6 +1700,8 @@ uint32_t TI64Value::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1562,9 +1712,29 @@ uint32_t TI64Value::read(::apache::thrift::protocol::TProtocol* iprot) { switch (fid) { case 1: - if (ftype == ::apache::thrift::protocol::T_I64) { - xfer += iprot->readI64(this->value); - this->__isset.value = true; + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size61; + ::apache::thrift::protocol::TType _etype64; + xfer += iprot->readListBegin(_etype64, _size61); + this->values.resize(_size61); + uint32_t _i65; + for (_i65 = 0; _i65 < _size61; ++_i65) + { + xfer += iprot->readI64(this->values[_i65]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1578,6 +1748,10 @@ uint32_t TI64Value::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1585,11 +1759,22 @@ uint32_t TI64Value::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("TI64Value"); - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I64, 1); - xfer += oprot->writeI64(this->value); - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->values.size())); + std::vector ::const_iterator _iter66; + for (_iter66 = this->values.begin(); _iter66 != this->values.end(); ++_iter66) + { + xfer += oprot->writeI64((*_iter66)); + } + xfer += oprot->writeListEnd(); } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1597,12 +1782,12 @@ uint32_t TI64Value::write(::apache::thrift::protocol::TProtocol* oprot) const { void swap(TI64Value &a, TI64Value &b) { using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -const char* TDoubleValue::ascii_fingerprint = "3586E570A474C4A8603B4FF74903B3A6"; -const uint8_t TDoubleValue::binary_fingerprint[16] = {0x35,0x86,0xE5,0x70,0xA4,0x74,0xC4,0xA8,0x60,0x3B,0x4F,0xF7,0x49,0x03,0xB3,0xA6}; +const char* TDoubleValue::ascii_fingerprint = "8FF1C050A8D7FD247AEB23CD71539C09"; +const uint8_t TDoubleValue::binary_fingerprint[16] = {0x8F,0xF1,0xC0,0x50,0xA8,0xD7,0xFD,0x24,0x7A,0xEB,0x23,0xCD,0x71,0x53,0x9C,0x09}; uint32_t TDoubleValue::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1615,6 +1800,8 @@ uint32_t TDoubleValue::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1625,9 +1812,29 @@ uint32_t TDoubleValue::read(::apache::thrift::protocol::TProtocol* iprot) { switch (fid) { case 1: - if (ftype == ::apache::thrift::protocol::T_DOUBLE) { - xfer += iprot->readDouble(this->value); - this->__isset.value = true; + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size67; + ::apache::thrift::protocol::TType _etype70; + xfer += iprot->readListBegin(_etype70, _size67); + this->values.resize(_size67); + uint32_t _i71; + for (_i71 = 0; _i71 < _size67; ++_i71) + { + xfer += iprot->readDouble(this->values[_i71]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1641,6 +1848,10 @@ uint32_t TDoubleValue::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1648,11 +1859,22 @@ uint32_t TDoubleValue::write(::apache::thrift::protocol::TProtocol* oprot) const uint32_t xfer = 0; xfer += oprot->writeStructBegin("TDoubleValue"); - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_DOUBLE, 1); - xfer += oprot->writeDouble(this->value); - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_DOUBLE, static_cast(this->values.size())); + std::vector ::const_iterator _iter72; + for (_iter72 = this->values.begin(); _iter72 != this->values.end(); ++_iter72) + { + xfer += oprot->writeDouble((*_iter72)); + } + xfer += oprot->writeListEnd(); } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1660,12 +1882,12 @@ uint32_t TDoubleValue::write(::apache::thrift::protocol::TProtocol* oprot) const void swap(TDoubleValue &a, TDoubleValue &b) { using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -const char* TStringValue::ascii_fingerprint = "66E694018C17E5B65A59AE8F55CCA3CD"; -const uint8_t TStringValue::binary_fingerprint[16] = {0x66,0xE6,0x94,0x01,0x8C,0x17,0xE5,0xB6,0x5A,0x59,0xAE,0x8F,0x55,0xCC,0xA3,0xCD}; +const char* TStringValue::ascii_fingerprint = "BE556BF7091B2DABBA1863D5E458B15F"; +const uint8_t TStringValue::binary_fingerprint[16] = {0xBE,0x55,0x6B,0xF7,0x09,0x1B,0x2D,0xAB,0xBA,0x18,0x63,0xD5,0xE4,0x58,0xB1,0x5F}; uint32_t TStringValue::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -1678,6 +1900,8 @@ uint32_t TStringValue::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1688,9 +1912,29 @@ uint32_t TStringValue::read(::apache::thrift::protocol::TProtocol* iprot) { switch (fid) { case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size73; + ::apache::thrift::protocol::TType _etype76; + xfer += iprot->readListBegin(_etype76, _size73); + this->values.resize(_size73); + uint32_t _i77; + for (_i77 = 0; _i77 < _size73; ++_i77) + { + xfer += iprot->readString(this->values[_i77]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->value); - this->__isset.value = true; + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1704,6 +1948,10 @@ uint32_t TStringValue::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -1711,11 +1959,22 @@ uint32_t TStringValue::write(::apache::thrift::protocol::TProtocol* oprot) const uint32_t xfer = 0; xfer += oprot->writeStructBegin("TStringValue"); - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->value); - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); + std::vector ::const_iterator _iter78; + for (_iter78 = this->values.begin(); _iter78 != this->values.end(); ++_iter78) + { + xfer += oprot->writeString((*_iter78)); + } + xfer += oprot->writeListEnd(); } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -1723,14 +1982,14 @@ uint32_t TStringValue::write(::apache::thrift::protocol::TProtocol* oprot) const void swap(TStringValue &a, TStringValue &b) { using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -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 = "BE556BF7091B2DABBA1863D5E458B15F"; +const uint8_t TBinaryValue::binary_fingerprint[16] = {0xBE,0x55,0x6B,0xF7,0x09,0x1B,0x2D,0xAB,0xBA,0x18,0x63,0xD5,0xE4,0x58,0xB1,0x5F}; -uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { +uint32_t TBinaryValue::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; @@ -1741,6 +2000,8 @@ uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; + bool isset_values = false; + bool isset_nulls = false; while (true) { @@ -1753,139 +2014,27 @@ uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { case 1: if (ftype == ::apache::thrift::protocol::T_LIST) { { - this->boolColumn.clear(); - uint32_t _size37; - ::apache::thrift::protocol::TType _etype40; - xfer += iprot->readListBegin(_etype40, _size37); - this->boolColumn.resize(_size37); - uint32_t _i41; - for (_i41 = 0; _i41 < _size37; ++_i41) + this->values.clear(); + uint32_t _size79; + ::apache::thrift::protocol::TType _etype82; + xfer += iprot->readListBegin(_etype82, _size79); + this->values.resize(_size79); + uint32_t _i83; + for (_i83 = 0; _i83 < _size79; ++_i83) { - xfer += this->boolColumn[_i41].read(iprot); + xfer += iprot->readBinary(this->values[_i83]); } xfer += iprot->readListEnd(); } - this->__isset.boolColumn = true; + isset_values = true; } else { xfer += iprot->skip(ftype); } break; case 2: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->byteColumn.clear(); - uint32_t _size42; - ::apache::thrift::protocol::TType _etype45; - xfer += iprot->readListBegin(_etype45, _size42); - this->byteColumn.resize(_size42); - uint32_t _i46; - for (_i46 = 0; _i46 < _size42; ++_i46) - { - xfer += this->byteColumn[_i46].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.byteColumn = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->i16Column.clear(); - uint32_t _size47; - ::apache::thrift::protocol::TType _etype50; - xfer += iprot->readListBegin(_etype50, _size47); - this->i16Column.resize(_size47); - uint32_t _i51; - for (_i51 = 0; _i51 < _size47; ++_i51) - { - xfer += this->i16Column[_i51].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.i16Column = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->i32Column.clear(); - uint32_t _size52; - ::apache::thrift::protocol::TType _etype55; - xfer += iprot->readListBegin(_etype55, _size52); - this->i32Column.resize(_size52); - uint32_t _i56; - for (_i56 = 0; _i56 < _size52; ++_i56) - { - xfer += this->i32Column[_i56].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.i32Column = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->i64Column.clear(); - uint32_t _size57; - ::apache::thrift::protocol::TType _etype60; - xfer += iprot->readListBegin(_etype60, _size57); - this->i64Column.resize(_size57); - uint32_t _i61; - for (_i61 = 0; _i61 < _size57; ++_i61) - { - xfer += this->i64Column[_i61].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.i64Column = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->doubleColumn.clear(); - uint32_t _size62; - ::apache::thrift::protocol::TType _etype65; - xfer += iprot->readListBegin(_etype65, _size62); - this->doubleColumn.resize(_size62); - uint32_t _i66; - for (_i66 = 0; _i66 < _size62; ++_i66) - { - xfer += this->doubleColumn[_i66].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.doubleColumn = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 7: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->stringColumn.clear(); - uint32_t _size67; - ::apache::thrift::protocol::TType _etype70; - xfer += iprot->readListBegin(_etype70, _size67); - this->stringColumn.resize(_size67); - uint32_t _i71; - for (_i71 = 0; _i71 < _size67; ++_i71) - { - xfer += this->stringColumn[_i71].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.stringColumn = true; + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; } else { xfer += iprot->skip(ftype); } @@ -1899,95 +2048,31 @@ uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { xfer += iprot->readStructEnd(); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } -uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { +uint32_t TBinaryValue::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TColumn"); - - 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) - { - xfer += (*_iter72).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); + xfer += oprot->writeStructBegin("TBinaryValue"); - xfer += oprot->writeFieldBegin("byteColumn", ::apache::thrift::protocol::T_LIST, 2); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); { - 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) + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); + std::vector ::const_iterator _iter84; + for (_iter84 = this->values.begin(); _iter84 != this->values.end(); ++_iter84) { - xfer += (*_iter73).write(oprot); + xfer += oprot->writeBinary((*_iter84)); } xfer += oprot->writeListEnd(); } xfer += oprot->writeFieldEnd(); - 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) - { - xfer += (*_iter74).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - 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) - { - xfer += (*_iter75).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - 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) - { - xfer += (*_iter76).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - 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) - { - xfer += (*_iter77).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - 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) - { - xfer += (*_iter78).write(oprot); - } - xfer += oprot->writeListEnd(); - } + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); @@ -1995,20 +2080,14 @@ uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { return xfer; } -void swap(TColumn &a, TColumn &b) { +void swap(TBinaryValue &a, TBinaryValue &b) { using ::std::swap; - swap(a.boolColumn, b.boolColumn); - swap(a.byteColumn, b.byteColumn); - swap(a.i16Column, b.i16Column); - swap(a.i32Column, b.i32Column); - swap(a.i64Column, b.i64Column); - swap(a.doubleColumn, b.doubleColumn); - swap(a.stringColumn, b.stringColumn); - swap(a.__isset, b.__isset); + swap(a.values, b.values); + swap(a.nulls, b.nulls); } -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 = "E6ADD10B4CDDE61A19E8878CC7039A17"; +const uint8_t TColumnValue::binary_fingerprint[16] = {0xE6,0xAD,0xD1,0x0B,0x4C,0xDD,0xE6,0x1A,0x19,0xE8,0x87,0x8C,0xC7,0x03,0x9A,0x17}; uint32_t TColumnValue::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -2086,6 +2165,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; @@ -2130,6 +2217,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; @@ -2144,95 +2235,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}; - -uint32_t TRow::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; - - bool isset_colVals = false; - - 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_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) - { - xfer += this->colVals[_i83].read(iprot); - } - xfer += iprot->readListEnd(); - } - isset_colVals = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_colVals) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TRow::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TRow"); - - 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) - { - xfer += (*_iter84).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TRow &a, TRow &b) { - using ::std::swap; - 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 = "E1067378CC0F0ABAD05696C7DD3A1C7B"; +const uint8_t TRowSet::binary_fingerprint[16] = {0xE1,0x06,0x73,0x78,0xCC,0x0F,0x0A,0xBA,0xD0,0x56,0x96,0xC7,0xDD,0x3A,0x1C,0x7B}; uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -2246,7 +2254,7 @@ uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { using ::apache::thrift::protocol::TProtocolException; bool isset_startRowOffset = false; - bool isset_rows = false; + bool isset_colVals = false; while (true) { @@ -2267,39 +2275,19 @@ uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { case 2: if (ftype == ::apache::thrift::protocol::T_LIST) { { - this->rows.clear(); + this->colVals.clear(); uint32_t _size85; ::apache::thrift::protocol::TType _etype88; xfer += iprot->readListBegin(_etype88, _size85); - this->rows.resize(_size85); + this->colVals.resize(_size85); uint32_t _i89; for (_i89 = 0; _i89 < _size85; ++_i89) { - xfer += this->rows[_i89].read(iprot); + xfer += this->colVals[_i89].read(iprot); } xfer += iprot->readListEnd(); } - isset_rows = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - 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) - { - xfer += this->columns[_i94].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.columns = true; + isset_colVals = true; } else { xfer += iprot->skip(ftype); } @@ -2315,7 +2303,7 @@ uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { if (!isset_startRowOffset) throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_rows) + if (!isset_colVals) throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } @@ -2328,31 +2316,18 @@ uint32_t TRowSet::write(::apache::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeI64(this->startRowOffset); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2); + xfer += oprot->writeFieldBegin("colVals", ::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) + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->colVals.size())); + std::vector ::const_iterator _iter90; + for (_iter90 = this->colVals.begin(); _iter90 != this->colVals.end(); ++_iter90) { - xfer += (*_iter95).write(oprot); + xfer += (*_iter90).write(oprot); } xfer += oprot->writeListEnd(); } xfer += oprot->writeFieldEnd(); - if (this->__isset.columns) { - 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) - { - xfer += (*_iter96).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - } xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -2361,9 +2336,7 @@ uint32_t TRowSet::write(::apache::thrift::protocol::TProtocol* oprot) const { void swap(TRowSet &a, TRowSet &b) { using ::std::swap; swap(a.startRowOffset, b.startRowOffset); - swap(a.rows, b.rows); - swap(a.columns, b.columns); - swap(a.__isset, b.__isset); + swap(a.colVals, b.colVals); } const char* TStatus::ascii_fingerprint = "D5DEF49634A59C615C1B3A6F7D0DADB5"; @@ -2392,9 +2365,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 ecast91; + xfer += iprot->readI32(ecast91); + this->statusCode = (TStatusCode::type)ecast91; isset_statusCode = true; } else { xfer += iprot->skip(ftype); @@ -2404,14 +2377,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 _size92; + ::apache::thrift::protocol::TType _etype95; + xfer += iprot->readListBegin(_etype95, _size92); + this->infoMessages.resize(_size92); + uint32_t _i96; + for (_i96 = 0; _i96 < _size92; ++_i96) { - xfer += iprot->readString(this->infoMessages[_i102]); + xfer += iprot->readString(this->infoMessages[_i96]); } xfer += iprot->readListEnd(); } @@ -2470,10 +2443,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 _iter97; + for (_iter97 = this->infoMessages.begin(); _iter97 != this->infoMessages.end(); ++_iter97) { - xfer += oprot->writeString((*_iter103)); + xfer += oprot->writeString((*_iter97)); } xfer += oprot->writeListEnd(); } @@ -2689,9 +2662,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 ecast98; + xfer += iprot->readI32(ecast98); + this->operationType = (TOperationType::type)ecast98; isset_operationType = true; } else { xfer += iprot->skip(ftype); @@ -2792,9 +2765,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 ecast99; + xfer += iprot->readI32(ecast99); + this->client_protocol = (TProtocolVersion::type)ecast99; isset_client_protocol = true; } else { xfer += iprot->skip(ftype); @@ -2820,17 +2793,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 _size100; + ::apache::thrift::protocol::TType _ktype101; + ::apache::thrift::protocol::TType _vtype102; + xfer += iprot->readMapBegin(_ktype101, _vtype102, _size100); + uint32_t _i104; + for (_i104 = 0; _i104 < _size100; ++_i104) { - std::string _key111; - xfer += iprot->readString(_key111); - std::string& _val112 = this->configuration[_key111]; - xfer += iprot->readString(_val112); + std::string _key105; + xfer += iprot->readString(_key105); + std::string& _val106 = this->configuration[_key105]; + xfer += iprot->readString(_val106); } xfer += iprot->readMapEnd(); } @@ -2875,11 +2848,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 _iter107; + for (_iter107 = this->configuration.begin(); _iter107 != this->configuration.end(); ++_iter107) { - xfer += oprot->writeString(_iter113->first); - xfer += oprot->writeString(_iter113->second); + xfer += oprot->writeString(_iter107->first); + xfer += oprot->writeString(_iter107->second); } xfer += oprot->writeMapEnd(); } @@ -2934,9 +2907,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 ecast108; + xfer += iprot->readI32(ecast108); + this->serverProtocolVersion = (TProtocolVersion::type)ecast108; isset_serverProtocolVersion = true; } else { xfer += iprot->skip(ftype); @@ -2954,17 +2927,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 _size109; + ::apache::thrift::protocol::TType _ktype110; + ::apache::thrift::protocol::TType _vtype111; + xfer += iprot->readMapBegin(_ktype110, _vtype111, _size109); + uint32_t _i113; + for (_i113 = 0; _i113 < _size109; ++_i113) { - std::string _key120; - xfer += iprot->readString(_key120); - std::string& _val121 = this->configuration[_key120]; - xfer += iprot->readString(_val121); + std::string _key114; + xfer += iprot->readString(_key114); + std::string& _val115 = this->configuration[_key114]; + xfer += iprot->readString(_val115); } xfer += iprot->readMapEnd(); } @@ -3010,11 +2983,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 _iter116; + for (_iter116 = this->configuration.begin(); _iter116 != this->configuration.end(); ++_iter116) { - xfer += oprot->writeString(_iter122->first); - xfer += oprot->writeString(_iter122->second); + xfer += oprot->writeString(_iter116->first); + xfer += oprot->writeString(_iter116->second); } xfer += oprot->writeMapEnd(); } @@ -3324,9 +3297,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 ecast117; + xfer += iprot->readI32(ecast117); + this->infoType = (TGetInfoType::type)ecast117; isset_infoType = true; } else { xfer += iprot->skip(ftype); @@ -3496,17 +3469,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 _size118; + ::apache::thrift::protocol::TType _ktype119; + ::apache::thrift::protocol::TType _vtype120; + xfer += iprot->readMapBegin(_ktype119, _vtype120, _size118); + uint32_t _i122; + for (_i122 = 0; _i122 < _size118; ++_i122) { - std::string _key129; - xfer += iprot->readString(_key129); - std::string& _val130 = this->confOverlay[_key129]; - xfer += iprot->readString(_val130); + std::string _key123; + xfer += iprot->readString(_key123); + std::string& _val124 = this->confOverlay[_key123]; + xfer += iprot->readString(_val124); } xfer += iprot->readMapEnd(); } @@ -3555,11 +3528,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 _iter125; + for (_iter125 = this->confOverlay.begin(); _iter125 != this->confOverlay.end(); ++_iter125) { - xfer += oprot->writeString(_iter131->first); - xfer += oprot->writeString(_iter131->second); + xfer += oprot->writeString(_iter125->first); + xfer += oprot->writeString(_iter125->second); } xfer += oprot->writeMapEnd(); } @@ -4181,14 +4154,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 _size126; + ::apache::thrift::protocol::TType _etype129; + xfer += iprot->readListBegin(_etype129, _size126); + this->tableTypes.resize(_size126); + uint32_t _i130; + for (_i130 = 0; _i130 < _size126; ++_i130) { - xfer += iprot->readString(this->tableTypes[_i136]); + xfer += iprot->readString(this->tableTypes[_i130]); } xfer += iprot->readListEnd(); } @@ -4238,10 +4211,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 _iter131; + for (_iter131 = this->tableTypes.begin(); _iter131 != this->tableTypes.end(); ++_iter131) { - xfer += oprot->writeString((*_iter137)); + xfer += oprot->writeString((*_iter131)); } xfer += oprot->writeListEnd(); } @@ -4970,9 +4943,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 ecast132; + xfer += iprot->readI32(ecast132); + this->operationState = (TOperationState::type)ecast132; this->__isset.operationState = true; } else { xfer += iprot->skip(ftype); @@ -5452,9 +5425,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 ecast133; + xfer += iprot->readI32(ecast133); + this->orientation = (TFetchOrientation::type)ecast133; isset_orientation = true; } else { xfer += iprot->skip(ftype); @@ -5514,8 +5487,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 = "2DCE0738D7D98BD2D93BEC657702B496"; +const uint8_t TFetchResultsResp::binary_fingerprint[16] = {0x2D,0xCE,0x07,0x38,0xD7,0xD9,0x8B,0xD2,0xD9,0x3B,0xEC,0x65,0x77,0x02,0xB4,0x96}; 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 853bb4c..9705b20 100644 --- service/src/gen/thrift/gen-cpp/TCLIService_types.h +++ service/src/gen/thrift/gen-cpp/TCLIService_types.h @@ -735,36 +735,34 @@ class TTableSchema { void swap(TTableSchema &a, TTableSchema &b); -typedef struct _TBoolValue__isset { - _TBoolValue__isset() : value(false) {} - bool value; -} _TBoolValue__isset; class TBoolValue { public: - static const char* ascii_fingerprint; // = "BF054652DEF86253C2BEE7D947F167DD"; - static const uint8_t binary_fingerprint[16]; // = {0xBF,0x05,0x46,0x52,0xDE,0xF8,0x62,0x53,0xC2,0xBE,0xE7,0xD9,0x47,0xF1,0x67,0xDD}; + static const char* ascii_fingerprint; // = "F9058324D96DB7F974D8ACDC01C54219"; + static const uint8_t binary_fingerprint[16]; // = {0xF9,0x05,0x83,0x24,0xD9,0x6D,0xB7,0xF9,0x74,0xD8,0xAC,0xDC,0x01,0xC5,0x42,0x19}; - TBoolValue() : value(0) { + TBoolValue() : nulls() { } virtual ~TBoolValue() throw() {} - bool value; + std::vector values; + std::string nulls; - _TBoolValue__isset __isset; + void __set_values(const std::vector & val) { + values = val; + } - void __set_value(const bool val) { - value = val; - __isset.value = true; + void __set_nulls(const std::string& val) { + nulls = val; } bool operator == (const TBoolValue & rhs) const { - if (__isset.value != rhs.__isset.value) + if (!(values == rhs.values)) return false; - else if (__isset.value && !(value == rhs.value)) + if (!(nulls == rhs.nulls)) return false; return true; } @@ -781,36 +779,34 @@ class TBoolValue { void swap(TBoolValue &a, TBoolValue &b); -typedef struct _TByteValue__isset { - _TByteValue__isset() : value(false) {} - bool value; -} _TByteValue__isset; class TByteValue { public: - static const char* ascii_fingerprint; // = "9C15298ACB5D04AEA9B52D5DDE6F9208"; - static const uint8_t binary_fingerprint[16]; // = {0x9C,0x15,0x29,0x8A,0xCB,0x5D,0x04,0xAE,0xA9,0xB5,0x2D,0x5D,0xDE,0x6F,0x92,0x08}; + static const char* ascii_fingerprint; // = "1CB300106BAA463A70BB2A2395900F48"; + static const uint8_t binary_fingerprint[16]; // = {0x1C,0xB3,0x00,0x10,0x6B,0xAA,0x46,0x3A,0x70,0xBB,0x2A,0x23,0x95,0x90,0x0F,0x48}; - TByteValue() : value(0) { + TByteValue() : nulls() { } virtual ~TByteValue() throw() {} - int8_t value; + std::vector values; + std::string nulls; - _TByteValue__isset __isset; + void __set_values(const std::vector & val) { + values = val; + } - void __set_value(const int8_t val) { - value = val; - __isset.value = true; + void __set_nulls(const std::string& val) { + nulls = val; } bool operator == (const TByteValue & rhs) const { - if (__isset.value != rhs.__isset.value) + if (!(values == rhs.values)) return false; - else if (__isset.value && !(value == rhs.value)) + if (!(nulls == rhs.nulls)) return false; return true; } @@ -827,36 +823,34 @@ class TByteValue { void swap(TByteValue &a, TByteValue &b); -typedef struct _TI16Value__isset { - _TI16Value__isset() : value(false) {} - bool value; -} _TI16Value__isset; class TI16Value { public: - static const char* ascii_fingerprint; // = "5DAC9C51C7E1106BF936FC71860BE9D5"; - static const uint8_t binary_fingerprint[16]; // = {0x5D,0xAC,0x9C,0x51,0xC7,0xE1,0x10,0x6B,0xF9,0x36,0xFC,0x71,0x86,0x0B,0xE9,0xD5}; + static const char* ascii_fingerprint; // = "6574CDB1F121C8DB47FB257A3F104BDB"; + static const uint8_t binary_fingerprint[16]; // = {0x65,0x74,0xCD,0xB1,0xF1,0x21,0xC8,0xDB,0x47,0xFB,0x25,0x7A,0x3F,0x10,0x4B,0xDB}; - TI16Value() : value(0) { + TI16Value() : nulls() { } virtual ~TI16Value() throw() {} - int16_t value; + std::vector values; + std::string nulls; - _TI16Value__isset __isset; + void __set_values(const std::vector & val) { + values = val; + } - void __set_value(const int16_t val) { - value = val; - __isset.value = true; + void __set_nulls(const std::string& val) { + nulls = val; } bool operator == (const TI16Value & rhs) const { - if (__isset.value != rhs.__isset.value) + if (!(values == rhs.values)) return false; - else if (__isset.value && !(value == rhs.value)) + if (!(nulls == rhs.nulls)) return false; return true; } @@ -873,36 +867,34 @@ class TI16Value { void swap(TI16Value &a, TI16Value &b); -typedef struct _TI32Value__isset { - _TI32Value__isset() : value(false) {} - bool value; -} _TI32Value__isset; class TI32Value { public: - static const char* ascii_fingerprint; // = "E7A96B151330359E84C0A3AC91BCBACD"; - static const uint8_t binary_fingerprint[16]; // = {0xE7,0xA9,0x6B,0x15,0x13,0x30,0x35,0x9E,0x84,0xC0,0xA3,0xAC,0x91,0xBC,0xBA,0xCD}; + static const char* ascii_fingerprint; // = "CCCCE89C7E9DA10280F5663700677313"; + static const uint8_t binary_fingerprint[16]; // = {0xCC,0xCC,0xE8,0x9C,0x7E,0x9D,0xA1,0x02,0x80,0xF5,0x66,0x37,0x00,0x67,0x73,0x13}; - TI32Value() : value(0) { + TI32Value() : nulls() { } virtual ~TI32Value() throw() {} - int32_t value; + std::vector values; + std::string nulls; - _TI32Value__isset __isset; + void __set_values(const std::vector & val) { + values = val; + } - void __set_value(const int32_t val) { - value = val; - __isset.value = true; + void __set_nulls(const std::string& val) { + nulls = val; } bool operator == (const TI32Value & rhs) const { - if (__isset.value != rhs.__isset.value) + if (!(values == rhs.values)) return false; - else if (__isset.value && !(value == rhs.value)) + if (!(nulls == rhs.nulls)) return false; return true; } @@ -919,36 +911,34 @@ class TI32Value { void swap(TI32Value &a, TI32Value &b); -typedef struct _TI64Value__isset { - _TI64Value__isset() : value(false) {} - bool value; -} _TI64Value__isset; class TI64Value { public: - static const char* ascii_fingerprint; // = "148F3AAAC1D9859963D5E800D187BF26"; - static const uint8_t binary_fingerprint[16]; // = {0x14,0x8F,0x3A,0xAA,0xC1,0xD9,0x85,0x99,0x63,0xD5,0xE8,0x00,0xD1,0x87,0xBF,0x26}; + static const char* ascii_fingerprint; // = "925353917FC0AF87976A2338011F5A31"; + static const uint8_t binary_fingerprint[16]; // = {0x92,0x53,0x53,0x91,0x7F,0xC0,0xAF,0x87,0x97,0x6A,0x23,0x38,0x01,0x1F,0x5A,0x31}; - TI64Value() : value(0) { + TI64Value() : nulls() { } virtual ~TI64Value() throw() {} - int64_t value; + std::vector values; + std::string nulls; - _TI64Value__isset __isset; + void __set_values(const std::vector & val) { + values = val; + } - void __set_value(const int64_t val) { - value = val; - __isset.value = true; + void __set_nulls(const std::string& val) { + nulls = val; } bool operator == (const TI64Value & rhs) const { - if (__isset.value != rhs.__isset.value) + if (!(values == rhs.values)) return false; - else if (__isset.value && !(value == rhs.value)) + if (!(nulls == rhs.nulls)) return false; return true; } @@ -965,36 +955,34 @@ class TI64Value { void swap(TI64Value &a, TI64Value &b); -typedef struct _TDoubleValue__isset { - _TDoubleValue__isset() : value(false) {} - bool value; -} _TDoubleValue__isset; class TDoubleValue { public: - static const char* ascii_fingerprint; // = "3586E570A474C4A8603B4FF74903B3A6"; - static const uint8_t binary_fingerprint[16]; // = {0x35,0x86,0xE5,0x70,0xA4,0x74,0xC4,0xA8,0x60,0x3B,0x4F,0xF7,0x49,0x03,0xB3,0xA6}; + static const char* ascii_fingerprint; // = "8FF1C050A8D7FD247AEB23CD71539C09"; + static const uint8_t binary_fingerprint[16]; // = {0x8F,0xF1,0xC0,0x50,0xA8,0xD7,0xFD,0x24,0x7A,0xEB,0x23,0xCD,0x71,0x53,0x9C,0x09}; - TDoubleValue() : value(0) { + TDoubleValue() : nulls() { } virtual ~TDoubleValue() throw() {} - double value; + std::vector values; + std::string nulls; - _TDoubleValue__isset __isset; + void __set_values(const std::vector & val) { + values = val; + } - void __set_value(const double val) { - value = val; - __isset.value = true; + void __set_nulls(const std::string& val) { + nulls = val; } bool operator == (const TDoubleValue & rhs) const { - if (__isset.value != rhs.__isset.value) + if (!(values == rhs.values)) return false; - else if (__isset.value && !(value == rhs.value)) + if (!(nulls == rhs.nulls)) return false; return true; } @@ -1011,36 +999,34 @@ class TDoubleValue { void swap(TDoubleValue &a, TDoubleValue &b); -typedef struct _TStringValue__isset { - _TStringValue__isset() : value(false) {} - bool value; -} _TStringValue__isset; class TStringValue { 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}; + static const char* ascii_fingerprint; // = "BE556BF7091B2DABBA1863D5E458B15F"; + static const uint8_t binary_fingerprint[16]; // = {0xBE,0x55,0x6B,0xF7,0x09,0x1B,0x2D,0xAB,0xBA,0x18,0x63,0xD5,0xE4,0x58,0xB1,0x5F}; - TStringValue() : value() { + TStringValue() : nulls() { } virtual ~TStringValue() throw() {} - std::string value; + std::vector values; + std::string nulls; - _TStringValue__isset __isset; + void __set_values(const std::vector & val) { + values = val; + } - void __set_value(const std::string& val) { - value = val; - __isset.value = true; + void __set_nulls(const std::string& val) { + nulls = val; } bool operator == (const TStringValue & rhs) const { - if (__isset.value != rhs.__isset.value) + if (!(values == rhs.values)) return false; - else if (__isset.value && !(value == rhs.value)) + if (!(nulls == rhs.nulls)) return false; return true; } @@ -1057,99 +1043,52 @@ class TStringValue { void swap(TStringValue &a, TStringValue &b); -typedef struct _TColumn__isset { - _TColumn__isset() : boolColumn(false), byteColumn(false), i16Column(false), i32Column(false), i64Column(false), doubleColumn(false), stringColumn(false) {} - bool boolColumn; - bool byteColumn; - bool i16Column; - bool i32Column; - bool i64Column; - bool doubleColumn; - bool stringColumn; -} _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}; - TColumn() { - } - - virtual ~TColumn() throw() {} - - std::vector boolColumn; - std::vector byteColumn; - std::vector i16Column; - std::vector i32Column; - std::vector i64Column; - std::vector doubleColumn; - std::vector stringColumn; - - _TColumn__isset __isset; +class TBinaryValue { + public: - void __set_boolColumn(const std::vector & val) { - boolColumn = val; - } + static const char* ascii_fingerprint; // = "BE556BF7091B2DABBA1863D5E458B15F"; + static const uint8_t binary_fingerprint[16]; // = {0xBE,0x55,0x6B,0xF7,0x09,0x1B,0x2D,0xAB,0xBA,0x18,0x63,0xD5,0xE4,0x58,0xB1,0x5F}; - void __set_byteColumn(const std::vector & val) { - byteColumn = val; + TBinaryValue() : nulls() { } - void __set_i16Column(const std::vector & val) { - i16Column = val; - } + virtual ~TBinaryValue() throw() {} - void __set_i32Column(const std::vector & val) { - i32Column = val; - } + std::vector values; + std::string nulls; - void __set_i64Column(const std::vector & val) { - i64Column = val; + void __set_values(const std::vector & val) { + values = val; } - void __set_doubleColumn(const std::vector & val) { - doubleColumn = val; + void __set_nulls(const std::string& val) { + nulls = val; } - void __set_stringColumn(const std::vector & val) { - stringColumn = val; - } - - bool operator == (const TColumn & rhs) const + bool operator == (const TBinaryValue & rhs) const { - if (!(boolColumn == rhs.boolColumn)) - return false; - if (!(byteColumn == rhs.byteColumn)) - return false; - if (!(i16Column == rhs.i16Column)) + if (!(values == rhs.values)) return false; - if (!(i32Column == rhs.i32Column)) - return false; - if (!(i64Column == rhs.i64Column)) - return false; - if (!(doubleColumn == rhs.doubleColumn)) - return false; - if (!(stringColumn == rhs.stringColumn)) + if (!(nulls == rhs.nulls)) return false; return true; } - bool operator != (const TColumn &rhs) const { + bool operator != (const TBinaryValue &rhs) const { return !(*this == rhs); } - bool operator < (const TColumn & ) const; + bool operator < (const TBinaryValue & ) const; uint32_t read(::apache::thrift::protocol::TProtocol* iprot); uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; }; -void swap(TColumn &a, TColumn &b); +void swap(TBinaryValue &a, TBinaryValue &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; @@ -1157,13 +1096,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; // = "E6ADD10B4CDDE61A19E8878CC7039A17"; + static const uint8_t binary_fingerprint[16]; // = {0xE6,0xAD,0xD1,0x0B,0x4C,0xDD,0xE6,0x1A,0x19,0xE8,0x87,0x8C,0xC7,0x03,0x9A,0x17}; TColumnValue() { } @@ -1177,6 +1117,7 @@ class TColumnValue { TI64Value i64Val; TDoubleValue doubleVal; TStringValue stringVal; + TBinaryValue binaryVal; _TColumnValue__isset __isset; @@ -1208,6 +1149,10 @@ class TColumnValue { stringVal = val; } + void __set_binaryVal(const TBinaryValue& val) { + binaryVal = val; + } + bool operator == (const TColumnValue & rhs) const { if (!(boolVal == rhs.boolVal)) @@ -1224,6 +1169,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 { @@ -1240,52 +1187,11 @@ class TColumnValue { 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}; - - TRow() { - } - - virtual ~TRow() throw() {} - - std::vector colVals; - - void __set_colVals(const std::vector & val) { - colVals = val; - } - - bool operator == (const TRow & rhs) const - { - if (!(colVals == rhs.colVals)) - return false; - return true; - } - bool operator != (const TRow &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TRow & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -void swap(TRow &a, TRow &b); - -typedef struct _TRowSet__isset { - _TRowSet__isset() : columns(false) {} - bool columns; -} _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; // = "E1067378CC0F0ABAD05696C7DD3A1C7B"; + static const uint8_t binary_fingerprint[16]; // = {0xE1,0x06,0x73,0x78,0xCC,0x0F,0x0A,0xBA,0xD0,0x56,0x96,0xC7,0xDD,0x3A,0x1C,0x7B}; TRowSet() : startRowOffset(0) { } @@ -1293,33 +1199,21 @@ class TRowSet { virtual ~TRowSet() throw() {} int64_t startRowOffset; - std::vector rows; - std::vector columns; - - _TRowSet__isset __isset; + std::vector colVals; void __set_startRowOffset(const int64_t val) { startRowOffset = val; } - void __set_rows(const std::vector & val) { - rows = val; - } - - void __set_columns(const std::vector & val) { - columns = val; - __isset.columns = true; + void __set_colVals(const std::vector & val) { + colVals = val; } bool operator == (const TRowSet & rhs) const { if (!(startRowOffset == rhs.startRowOffset)) return false; - if (!(rows == rhs.rows)) - return false; - if (__isset.columns != rhs.__isset.columns) - return false; - else if (__isset.columns && !(columns == rhs.columns)) + if (!(colVals == rhs.colVals)) return false; return true; } @@ -3268,8 +3162,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; // = "2DCE0738D7D98BD2D93BEC657702B496"; + static const uint8_t binary_fingerprint[16]; // = {0x2D,0xCE,0x07,0x38,0xD7,0xD9,0x8B,0xD2,0xD9,0x3B,0xEC,0x65,0x77,0x02,0xB4,0x96}; 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..706ccc7 --- /dev/null +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBinaryValue.java @@ -0,0 +1,550 @@ +/** + * 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 VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBinaryValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBinaryValueTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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() { + } + + public TBinaryValue( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + + /** + * Performs a deep copy on other. + */ + public TBinaryValue(TBinaryValue other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (ByteBuffer other_element : other.values) { + ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); +; + __this__values.add(temp_binary_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; + } + } + + public TBinaryValue deepCopy() { + return new TBinaryValue(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(ByteBuffer elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + 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_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); + + 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(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); + 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; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); + struct.values = new ArrayList(_list102.size); + for (int _i103 = 0; _i103 < _list102.size; ++_i103) + { + ByteBuffer _elem104; // required + _elem104 = iprot.readBinary(); + struct.values.add(_elem104); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (ByteBuffer _iter105 : struct.values) + { + oprot.writeBinary(_iter105); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + 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; + { + oprot.writeI32(struct.values.size()); + for (ByteBuffer _iter106 : struct.values) + { + oprot.writeBinary(_iter106); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryValue 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.STRING, iprot.readI32()); + struct.values = new ArrayList(_list107.size); + for (int _i108 = 0; _i108 < _list107.size; ++_i108) + { + ByteBuffer _elem109; // required + _elem109 = iprot.readBinary(); + struct.values.add(_elem109); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBoolValue.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBoolValue.java index c7495ee..a385292 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBoolValue.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TBoolValue.java @@ -34,7 +34,8 @@ public class TBoolValue 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("TBoolValue"); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,11 +43,13 @@ schemes.put(TupleScheme.class, new TBoolValueTupleSchemeFactory()); } - private boolean value; // optional + private List values; // required + private ByteBuffer nulls; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); private static final Map byName = new HashMap(); @@ -61,8 +64,10 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VALUE - return VALUE; + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; default: return null; } @@ -103,14 +108,14 @@ public String getFieldName() { } // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - 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.BOOL))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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(TBoolValue.class, metaDataMap); } @@ -118,12 +123,30 @@ public String getFieldName() { public TBoolValue() { } + public TBoolValue( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + /** * Performs a deep copy on other. */ public TBoolValue(TBoolValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (Boolean other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; + } } public TBoolValue deepCopy() { @@ -132,39 +155,95 @@ public TBoolValue deepCopy() { @Override public void clear() { - setValueIsSet(false); - this.value = false; + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(boolean elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; } - public boolean isValue() { - return this.value; + public void unsetValues() { + this.values = null; } - public void setValue(boolean value) { - this.value = value; - setValueIsSet(true); + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; } - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; } - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; } - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case VALUE: + case VALUES: if (value == null) { - unsetValue(); + unsetValues(); } else { - setValue((Boolean)value); + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); } break; @@ -173,8 +252,11 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { - case VALUE: - return Boolean.valueOf(isValue()); + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); } throw new IllegalStateException(); @@ -187,8 +269,10 @@ public boolean isSet(_Fields field) { } switch (field) { - case VALUE: - return isSetValue(); + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); } throw new IllegalStateException(); } @@ -206,12 +290,21 @@ public boolean equals(TBoolValue 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)) + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) return false; - if (this.value != that.value) + if (!this.nulls.equals(that.nulls)) return false; } @@ -222,10 +315,15 @@ public boolean equals(TBoolValue that) { public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); return builder.toHashCode(); } @@ -238,12 +336,22 @@ public int compareTo(TBoolValue other) { int lastComparison = 0; TBoolValue typedOther = (TBoolValue)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); if (lastComparison != 0) { return lastComparison; } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); if (lastComparison != 0) { return lastComparison; } @@ -268,17 +376,35 @@ public String toString() { StringBuilder sb = new StringBuilder("TBoolValue("); boolean first = true; - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -292,8 +418,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; 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); @@ -318,10 +442,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue struct) break; } switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.value = iprot.readBool(); - struct.setValueIsSet(true); + case 1: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); + struct.values = new ArrayList(_list46.size); + for (int _i47 = 0; _i47 < _list46.size; ++_i47) + { + boolean _elem48; // required + _elem48 = iprot.readBool(); + struct.values.add(_elem48); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -339,9 +481,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolValue struct) struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeBool(struct.value); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.values.size())); + for (boolean _iter49 : struct.values) + { + oprot.writeBool(_iter49); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -361,24 +515,32 @@ public TBoolValueTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue 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.writeBool(struct.value); + { + oprot.writeI32(struct.values.size()); + for (boolean _iter50 : struct.values) + { + oprot.writeBool(_iter50); + } } + oprot.writeBinary(struct.nulls); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readBool(); - struct.setValueIsSet(true); + { + org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); + struct.values = new ArrayList(_list51.size); + for (int _i52 = 0; _i52 < _list51.size; ++_i52) + { + boolean _elem53; // required + _elem53 = iprot.readBool(); + struct.values.add(_elem53); + } } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } } diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TByteValue.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TByteValue.java index 23d9693..0d304e0 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TByteValue.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TByteValue.java @@ -34,7 +34,8 @@ public class TByteValue 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("TByteValue"); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,11 +43,13 @@ schemes.put(TupleScheme.class, new TByteValueTupleSchemeFactory()); } - private byte value; // optional + private List values; // required + private ByteBuffer nulls; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); private static final Map byName = new HashMap(); @@ -61,8 +64,10 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VALUE - return VALUE; + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; default: return null; } @@ -103,14 +108,14 @@ public String getFieldName() { } // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - 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.BYTE))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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(TByteValue.class, metaDataMap); } @@ -118,12 +123,30 @@ public String getFieldName() { public TByteValue() { } + public TByteValue( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + /** * Performs a deep copy on other. */ public TByteValue(TByteValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (Byte other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; + } } public TByteValue deepCopy() { @@ -132,39 +155,95 @@ public TByteValue deepCopy() { @Override public void clear() { - setValueIsSet(false); - this.value = 0; + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(byte elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; } - public byte getValue() { - return this.value; + public void unsetValues() { + this.values = null; } - public void setValue(byte value) { - this.value = value; - setValueIsSet(true); + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; } - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; } - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; } - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case VALUE: + case VALUES: if (value == null) { - unsetValue(); + unsetValues(); } else { - setValue((Byte)value); + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); } break; @@ -173,8 +252,11 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { - case VALUE: - return Byte.valueOf(getValue()); + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); } throw new IllegalStateException(); @@ -187,8 +269,10 @@ public boolean isSet(_Fields field) { } switch (field) { - case VALUE: - return isSetValue(); + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); } throw new IllegalStateException(); } @@ -206,12 +290,21 @@ public boolean equals(TByteValue 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)) + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) return false; - if (this.value != that.value) + if (!this.nulls.equals(that.nulls)) return false; } @@ -222,10 +315,15 @@ public boolean equals(TByteValue that) { public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); return builder.toHashCode(); } @@ -238,12 +336,22 @@ public int compareTo(TByteValue other) { int lastComparison = 0; TByteValue typedOther = (TByteValue)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); if (lastComparison != 0) { return lastComparison; } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); if (lastComparison != 0) { return lastComparison; } @@ -268,17 +376,35 @@ public String toString() { StringBuilder sb = new StringBuilder("TByteValue("); boolean first = true; - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -292,8 +418,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; 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); @@ -318,10 +442,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue struct) break; } switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { - struct.value = iprot.readByte(); - struct.setValueIsSet(true); + case 1: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); + struct.values = new ArrayList(_list54.size); + for (int _i55 = 0; _i55 < _list54.size; ++_i55) + { + byte _elem56; // required + _elem56 = iprot.readByte(); + struct.values.add(_elem56); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -339,9 +481,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TByteValue struct) struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeByte(struct.value); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, struct.values.size())); + for (byte _iter57 : struct.values) + { + oprot.writeByte(_iter57); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -361,24 +515,32 @@ public TByteValueTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue 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.writeByte(struct.value); + { + oprot.writeI32(struct.values.size()); + for (byte _iter58 : struct.values) + { + oprot.writeByte(_iter58); + } } + oprot.writeBinary(struct.nulls); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readByte(); - struct.setValueIsSet(true); + { + org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); + struct.values = new ArrayList(_list59.size); + for (int _i60 = 0; _i60 < _list59.size; ++_i60) + { + byte _elem61; // required + _elem61 = iprot.readByte(); + struct.values.add(_elem61); + } } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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 deleted file mode 100644 index 497cc01..0000000 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java +++ /dev/null @@ -1,916 +0,0 @@ -/** - * 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 TColumn extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); - private static final org.apache.thrift.protocol.TField BOOL_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("boolColumn", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("byteColumn", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField I16_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Column", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField I32_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Column", org.apache.thrift.protocol.TType.LIST, (short)4); - 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); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_COLUMN((short)1, "boolColumn"), - BYTE_COLUMN((short)2, "byteColumn"), - I16_COLUMN((short)3, "i16Column"), - I32_COLUMN((short)4, "i32Column"), - I64_COLUMN((short)5, "i64Column"), - DOUBLE_COLUMN((short)6, "doubleColumn"), - STRING_COLUMN((short)7, "stringColumn"); - - 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: // BOOL_COLUMN - return BOOL_COLUMN; - case 2: // BYTE_COLUMN - return BYTE_COLUMN; - case 3: // I16_COLUMN - return I16_COLUMN; - case 4: // I32_COLUMN - return I32_COLUMN; - case 5: // I64_COLUMN - return I64_COLUMN; - case 6: // DOUBLE_COLUMN - return DOUBLE_COLUMN; - case 7: // STRING_COLUMN - return STRING_COLUMN; - 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; - } - } - - 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.BOOL_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("boolColumn", 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, TBoolValue.class)))); - tmpMap.put(_Fields.BYTE_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("byteColumn", 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, TByteValue.class)))); - tmpMap.put(_Fields.I16_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("i16Column", 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, TI16Value.class)))); - tmpMap.put(_Fields.I32_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("i32Column", 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, TI32Value.class)))); - tmpMap.put(_Fields.I64_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("i64Column", 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, TI64Value.class)))); - tmpMap.put(_Fields.DOUBLE_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("doubleColumn", 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, TDoubleValue.class)))); - 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)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); - } - - public TColumn() { - super(); - } - - public TColumn(_Fields setField, Object value) { - super(setField, value); - } - - public TColumn(TColumn other) { - super(other); - } - public TColumn deepCopy() { - return new TColumn(this); - } - - public static TColumn boolColumn(List value) { - TColumn x = new TColumn(); - x.setBoolColumn(value); - return x; - } - - public static TColumn byteColumn(List value) { - TColumn x = new TColumn(); - x.setByteColumn(value); - return x; - } - - public static TColumn i16Column(List value) { - TColumn x = new TColumn(); - x.setI16Column(value); - return x; - } - - public static TColumn i32Column(List value) { - TColumn x = new TColumn(); - x.setI32Column(value); - return x; - } - - public static TColumn i64Column(List value) { - TColumn x = new TColumn(); - x.setI64Column(value); - return x; - } - - public static TColumn doubleColumn(List value) { - TColumn x = new TColumn(); - x.setDoubleColumn(value); - return x; - } - - public static TColumn stringColumn(List value) { - TColumn x = new TColumn(); - x.setStringColumn(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case BOOL_COLUMN: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List for field 'boolColumn', but got " + value.getClass().getSimpleName()); - case BYTE_COLUMN: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List for field 'byteColumn', but got " + value.getClass().getSimpleName()); - case I16_COLUMN: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List for field 'i16Column', but got " + value.getClass().getSimpleName()); - case I32_COLUMN: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List for field 'i32Column', but got " + value.getClass().getSimpleName()); - case I64_COLUMN: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List for field 'i64Column', but got " + value.getClass().getSimpleName()); - case DOUBLE_COLUMN: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List for field 'doubleColumn', but got " + value.getClass().getSimpleName()); - case STRING_COLUMN: - if (value instanceof List) { - break; - } - throw new ClassCastException("Was expecting value of type List for field 'stringColumn', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case BOOL_COLUMN: - if (field.type == BOOL_COLUMN_FIELD_DESC.type) { - List boolColumn; - { - org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); - boolColumn = new ArrayList(_list46.size); - for (int _i47 = 0; _i47 < _list46.size; ++_i47) - { - TBoolValue _elem48; // optional - _elem48 = new TBoolValue(); - _elem48.read(iprot); - boolColumn.add(_elem48); - } - iprot.readListEnd(); - } - return boolColumn; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BYTE_COLUMN: - if (field.type == BYTE_COLUMN_FIELD_DESC.type) { - List byteColumn; - { - org.apache.thrift.protocol.TList _list49 = iprot.readListBegin(); - byteColumn = new ArrayList(_list49.size); - for (int _i50 = 0; _i50 < _list49.size; ++_i50) - { - TByteValue _elem51; // optional - _elem51 = new TByteValue(); - _elem51.read(iprot); - byteColumn.add(_elem51); - } - iprot.readListEnd(); - } - return byteColumn; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I16_COLUMN: - if (field.type == I16_COLUMN_FIELD_DESC.type) { - List i16Column; - { - org.apache.thrift.protocol.TList _list52 = iprot.readListBegin(); - i16Column = new ArrayList(_list52.size); - for (int _i53 = 0; _i53 < _list52.size; ++_i53) - { - TI16Value _elem54; // optional - _elem54 = new TI16Value(); - _elem54.read(iprot); - i16Column.add(_elem54); - } - iprot.readListEnd(); - } - return i16Column; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I32_COLUMN: - if (field.type == I32_COLUMN_FIELD_DESC.type) { - List i32Column; - { - org.apache.thrift.protocol.TList _list55 = iprot.readListBegin(); - i32Column = new ArrayList(_list55.size); - for (int _i56 = 0; _i56 < _list55.size; ++_i56) - { - TI32Value _elem57; // optional - _elem57 = new TI32Value(); - _elem57.read(iprot); - i32Column.add(_elem57); - } - iprot.readListEnd(); - } - return i32Column; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I64_COLUMN: - if (field.type == I64_COLUMN_FIELD_DESC.type) { - List i64Column; - { - org.apache.thrift.protocol.TList _list58 = iprot.readListBegin(); - i64Column = new ArrayList(_list58.size); - for (int _i59 = 0; _i59 < _list58.size; ++_i59) - { - TI64Value _elem60; // optional - _elem60 = new TI64Value(); - _elem60.read(iprot); - i64Column.add(_elem60); - } - iprot.readListEnd(); - } - return i64Column; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_COLUMN: - if (field.type == DOUBLE_COLUMN_FIELD_DESC.type) { - List doubleColumn; - { - org.apache.thrift.protocol.TList _list61 = iprot.readListBegin(); - doubleColumn = new ArrayList(_list61.size); - for (int _i62 = 0; _i62 < _list61.size; ++_i62) - { - TDoubleValue _elem63; // optional - _elem63 = new TDoubleValue(); - _elem63.read(iprot); - doubleColumn.add(_elem63); - } - iprot.readListEnd(); - } - return doubleColumn; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_COLUMN: - if (field.type == STRING_COLUMN_FIELD_DESC.type) { - List stringColumn; - { - org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); - stringColumn = new ArrayList(_list64.size); - for (int _i65 = 0; _i65 < _list64.size; ++_i65) - { - TStringValue _elem66; // optional - _elem66 = new TStringValue(); - _elem66.read(iprot); - stringColumn.add(_elem66); - } - iprot.readListEnd(); - } - return stringColumn; - } 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!"); - } - } else { - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_COLUMN: - List boolColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, boolColumn.size())); - for (TBoolValue _iter67 : boolColumn) - { - _iter67.write(oprot); - } - oprot.writeListEnd(); - } - return; - case BYTE_COLUMN: - List byteColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, byteColumn.size())); - for (TByteValue _iter68 : byteColumn) - { - _iter68.write(oprot); - } - oprot.writeListEnd(); - } - return; - case I16_COLUMN: - List i16Column = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i16Column.size())); - for (TI16Value _iter69 : i16Column) - { - _iter69.write(oprot); - } - oprot.writeListEnd(); - } - return; - case I32_COLUMN: - List i32Column = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i32Column.size())); - for (TI32Value _iter70 : i32Column) - { - _iter70.write(oprot); - } - oprot.writeListEnd(); - } - return; - case I64_COLUMN: - List i64Column = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i64Column.size())); - for (TI64Value _iter71 : i64Column) - { - _iter71.write(oprot); - } - oprot.writeListEnd(); - } - return; - case DOUBLE_COLUMN: - List doubleColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, doubleColumn.size())); - for (TDoubleValue _iter72 : doubleColumn) - { - _iter72.write(oprot); - } - oprot.writeListEnd(); - } - return; - case STRING_COLUMN: - List stringColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, stringColumn.size())); - for (TStringValue _iter73 : stringColumn) - { - _iter73.write(oprot); - } - oprot.writeListEnd(); - } - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - 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) - { - TBoolValue _elem76; // optional - _elem76 = new TBoolValue(); - _elem76.read(iprot); - boolColumn.add(_elem76); - } - iprot.readListEnd(); - } - return boolColumn; - 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) - { - TByteValue _elem79; // optional - _elem79 = new TByteValue(); - _elem79.read(iprot); - byteColumn.add(_elem79); - } - iprot.readListEnd(); - } - return byteColumn; - 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) - { - TI16Value _elem82; // optional - _elem82 = new TI16Value(); - _elem82.read(iprot); - i16Column.add(_elem82); - } - iprot.readListEnd(); - } - return i16Column; - 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) - { - TI32Value _elem85; // optional - _elem85 = new TI32Value(); - _elem85.read(iprot); - i32Column.add(_elem85); - } - iprot.readListEnd(); - } - return i32Column; - 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) - { - TI64Value _elem88; // optional - _elem88 = new TI64Value(); - _elem88.read(iprot); - i64Column.add(_elem88); - } - iprot.readListEnd(); - } - return i64Column; - 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) - { - TDoubleValue _elem91; // optional - _elem91 = new TDoubleValue(); - _elem91.read(iprot); - doubleColumn.add(_elem91); - } - iprot.readListEnd(); - } - return doubleColumn; - 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) - { - TStringValue _elem94; // optional - _elem94 = new TStringValue(); - _elem94.read(iprot); - stringColumn.add(_elem94); - } - iprot.readListEnd(); - } - return stringColumn; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_COLUMN: - List boolColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, boolColumn.size())); - for (TBoolValue _iter95 : boolColumn) - { - _iter95.write(oprot); - } - oprot.writeListEnd(); - } - return; - case BYTE_COLUMN: - List byteColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, byteColumn.size())); - for (TByteValue _iter96 : byteColumn) - { - _iter96.write(oprot); - } - oprot.writeListEnd(); - } - return; - case I16_COLUMN: - List i16Column = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i16Column.size())); - for (TI16Value _iter97 : i16Column) - { - _iter97.write(oprot); - } - oprot.writeListEnd(); - } - return; - case I32_COLUMN: - List i32Column = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i32Column.size())); - for (TI32Value _iter98 : i32Column) - { - _iter98.write(oprot); - } - oprot.writeListEnd(); - } - return; - case I64_COLUMN: - List i64Column = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, i64Column.size())); - for (TI64Value _iter99 : i64Column) - { - _iter99.write(oprot); - } - oprot.writeListEnd(); - } - return; - case DOUBLE_COLUMN: - List doubleColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, doubleColumn.size())); - for (TDoubleValue _iter100 : doubleColumn) - { - _iter100.write(oprot); - } - oprot.writeListEnd(); - } - return; - case STRING_COLUMN: - List stringColumn = (List)value_; - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, stringColumn.size())); - for (TStringValue _iter101 : stringColumn) - { - _iter101.write(oprot); - } - oprot.writeListEnd(); - } - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case BOOL_COLUMN: - return BOOL_COLUMN_FIELD_DESC; - case BYTE_COLUMN: - return BYTE_COLUMN_FIELD_DESC; - case I16_COLUMN: - return I16_COLUMN_FIELD_DESC; - case I32_COLUMN: - return I32_COLUMN_FIELD_DESC; - case I64_COLUMN: - return I64_COLUMN_FIELD_DESC; - case DOUBLE_COLUMN: - return DOUBLE_COLUMN_FIELD_DESC; - case STRING_COLUMN: - return STRING_COLUMN_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public List getBoolColumn() { - if (getSetField() == _Fields.BOOL_COLUMN) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'boolColumn' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBoolColumn(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BOOL_COLUMN; - value_ = value; - } - - public List getByteColumn() { - if (getSetField() == _Fields.BYTE_COLUMN) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'byteColumn' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setByteColumn(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BYTE_COLUMN; - value_ = value; - } - - public List getI16Column() { - if (getSetField() == _Fields.I16_COLUMN) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i16Column' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI16Column(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I16_COLUMN; - value_ = value; - } - - public List getI32Column() { - if (getSetField() == _Fields.I32_COLUMN) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i32Column' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Column(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I32_COLUMN; - value_ = value; - } - - public List getI64Column() { - if (getSetField() == _Fields.I64_COLUMN) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i64Column' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI64Column(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I64_COLUMN; - value_ = value; - } - - public List getDoubleColumn() { - if (getSetField() == _Fields.DOUBLE_COLUMN) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'doubleColumn' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDoubleColumn(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.DOUBLE_COLUMN; - value_ = value; - } - - public List getStringColumn() { - if (getSetField() == _Fields.STRING_COLUMN) { - return (List)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringColumn' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringColumn(List value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_COLUMN; - value_ = value; - } - - public boolean isSetBoolColumn() { - return setField_ == _Fields.BOOL_COLUMN; - } - - - public boolean isSetByteColumn() { - return setField_ == _Fields.BYTE_COLUMN; - } - - - public boolean isSetI16Column() { - return setField_ == _Fields.I16_COLUMN; - } - - - public boolean isSetI32Column() { - return setField_ == _Fields.I32_COLUMN; - } - - - public boolean isSetI64Column() { - return setField_ == _Fields.I64_COLUMN; - } - - - public boolean isSetDoubleColumn() { - return setField_ == _Fields.DOUBLE_COLUMN; - } - - - public boolean isSetStringColumn() { - return setField_ == _Fields.STRING_COLUMN; - } - - - public boolean equals(Object other) { - if (other instanceof TColumn) { - return equals((TColumn)other); - } else { - return false; - } - } - - public boolean equals(TColumn other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TColumn other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - 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); - } - } - - -} 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/TDoubleValue.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TDoubleValue.java index d215736..e6cf4f7 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TDoubleValue.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TDoubleValue.java @@ -34,7 +34,8 @@ public class TDoubleValue 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("TDoubleValue"); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,11 +43,13 @@ schemes.put(TupleScheme.class, new TDoubleValueTupleSchemeFactory()); } - private double value; // optional + private List values; // required + private ByteBuffer nulls; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); private static final Map byName = new HashMap(); @@ -61,8 +64,10 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VALUE - return VALUE; + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; default: return null; } @@ -103,14 +108,14 @@ public String getFieldName() { } // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - 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.DOUBLE))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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(TDoubleValue.class, metaDataMap); } @@ -118,12 +123,30 @@ public String getFieldName() { public TDoubleValue() { } + public TDoubleValue( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + /** * Performs a deep copy on other. */ public TDoubleValue(TDoubleValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (Double other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; + } } public TDoubleValue deepCopy() { @@ -132,39 +155,95 @@ public TDoubleValue deepCopy() { @Override public void clear() { - setValueIsSet(false); - this.value = 0.0; + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(double elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; } - public double getValue() { - return this.value; + public void unsetValues() { + this.values = null; } - public void setValue(double value) { - this.value = value; - setValueIsSet(true); + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; } - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; } - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; } - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case VALUE: + case VALUES: if (value == null) { - unsetValue(); + unsetValues(); } else { - setValue((Double)value); + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); } break; @@ -173,8 +252,11 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { - case VALUE: - return Double.valueOf(getValue()); + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); } throw new IllegalStateException(); @@ -187,8 +269,10 @@ public boolean isSet(_Fields field) { } switch (field) { - case VALUE: - return isSetValue(); + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); } throw new IllegalStateException(); } @@ -206,12 +290,21 @@ public boolean equals(TDoubleValue 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)) + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) return false; - if (this.value != that.value) + if (!this.nulls.equals(that.nulls)) return false; } @@ -222,10 +315,15 @@ public boolean equals(TDoubleValue that) { public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); return builder.toHashCode(); } @@ -238,12 +336,22 @@ public int compareTo(TDoubleValue other) { int lastComparison = 0; TDoubleValue typedOther = (TDoubleValue)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); if (lastComparison != 0) { return lastComparison; } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); if (lastComparison != 0) { return lastComparison; } @@ -268,17 +376,35 @@ public String toString() { StringBuilder sb = new StringBuilder("TDoubleValue("); boolean first = true; - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -292,8 +418,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; 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); @@ -318,10 +442,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue struct break; } switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(true); + case 1: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); + struct.values = new ArrayList(_list86.size); + for (int _i87 = 0; _i87 < _list86.size; ++_i87) + { + double _elem88; // required + _elem88 = iprot.readDouble(); + struct.values.add(_elem88); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -339,9 +481,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleValue struc struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeDouble(struct.value); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, struct.values.size())); + for (double _iter89 : struct.values) + { + oprot.writeDouble(_iter89); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -361,24 +515,32 @@ public TDoubleValueTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue 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.writeDouble(struct.value); + { + oprot.writeI32(struct.values.size()); + for (double _iter90 : struct.values) + { + oprot.writeDouble(_iter90); + } } + oprot.writeBinary(struct.nulls); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(true); + { + org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); + struct.values = new ArrayList(_list91.size); + for (int _i92 = 0; _i92 < _list91.size; ++_i92) + { + double _elem93; // required + _elem93 = iprot.readDouble(); + struct.values.add(_elem93); + } } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } } 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..779bcac 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 _map146 = iprot.readMapBegin(); + struct.confOverlay = new HashMap(2*_map146.size); + for (int _i147 = 0; _i147 < _map146.size; ++_i147) { - String _key156; // required - String _val157; // required - _key156 = iprot.readString(); - _val157 = iprot.readString(); - struct.confOverlay.put(_key156, _val157); + String _key148; // required + String _val149; // required + _key148 = iprot.readString(); + _val149 = iprot.readString(); + struct.confOverlay.put(_key148, _val149); } 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 _iter150 : struct.confOverlay.entrySet()) { - oprot.writeString(_iter158.getKey()); - oprot.writeString(_iter158.getValue()); + oprot.writeString(_iter150.getKey()); + oprot.writeString(_iter150.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 _iter151 : struct.confOverlay.entrySet()) { - oprot.writeString(_iter159.getKey()); - oprot.writeString(_iter159.getValue()); + oprot.writeString(_iter151.getKey()); + oprot.writeString(_iter151.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 _map152 = 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*_map152.size); + for (int _i153 = 0; _i153 < _map152.size; ++_i153) { - String _key162; // required - String _val163; // required - _key162 = iprot.readString(); - _val163 = iprot.readString(); - struct.confOverlay.put(_key162, _val163); + String _key154; // required + String _val155; // required + _key154 = iprot.readString(); + _val155 = iprot.readString(); + struct.confOverlay.put(_key154, _val155); } } 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..c15a7c0 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 _list156 = iprot.readListBegin(); + struct.tableTypes = new ArrayList(_list156.size); + for (int _i157 = 0; _i157 < _list156.size; ++_i157) { - String _elem166; // optional - _elem166 = iprot.readString(); - struct.tableTypes.add(_elem166); + String _elem158; // required + _elem158 = iprot.readString(); + struct.tableTypes.add(_elem158); } 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 _iter159 : struct.tableTypes) { - oprot.writeString(_iter167); + oprot.writeString(_iter159); } 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 _iter160 : struct.tableTypes) { - oprot.writeString(_iter168); + oprot.writeString(_iter160); } } } @@ -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 _list161 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tableTypes = new ArrayList(_list161.size); + for (int _i162 = 0; _i162 < _list161.size; ++_i162) { - String _elem171; // optional - _elem171 = iprot.readString(); - struct.tableTypes.add(_elem171); + String _elem163; // required + _elem163 = iprot.readString(); + struct.tableTypes.add(_elem163); } } struct.setTableTypesIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI16Value.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI16Value.java index bb5ae96..b4d335c 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI16Value.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI16Value.java @@ -34,7 +34,8 @@ public class TI16Value 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("TI16Value"); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,11 +43,13 @@ schemes.put(TupleScheme.class, new TI16ValueTupleSchemeFactory()); } - private short value; // optional + private List values; // required + private ByteBuffer nulls; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); private static final Map byName = new HashMap(); @@ -61,8 +64,10 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VALUE - return VALUE; + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; default: return null; } @@ -103,14 +108,14 @@ public String getFieldName() { } // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - 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.I16))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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(TI16Value.class, metaDataMap); } @@ -118,12 +123,30 @@ public String getFieldName() { public TI16Value() { } + public TI16Value( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + /** * Performs a deep copy on other. */ public TI16Value(TI16Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (Short other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; + } } public TI16Value deepCopy() { @@ -132,39 +155,95 @@ public TI16Value deepCopy() { @Override public void clear() { - setValueIsSet(false); - this.value = 0; + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(short elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; } - public short getValue() { - return this.value; + public void unsetValues() { + this.values = null; } - public void setValue(short value) { - this.value = value; - setValueIsSet(true); + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; } - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; } - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; } - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case VALUE: + case VALUES: if (value == null) { - unsetValue(); + unsetValues(); } else { - setValue((Short)value); + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); } break; @@ -173,8 +252,11 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { - case VALUE: - return Short.valueOf(getValue()); + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); } throw new IllegalStateException(); @@ -187,8 +269,10 @@ public boolean isSet(_Fields field) { } switch (field) { - case VALUE: - return isSetValue(); + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); } throw new IllegalStateException(); } @@ -206,12 +290,21 @@ public boolean equals(TI16Value 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)) + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) return false; - if (this.value != that.value) + if (!this.nulls.equals(that.nulls)) return false; } @@ -222,10 +315,15 @@ public boolean equals(TI16Value that) { public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); return builder.toHashCode(); } @@ -238,12 +336,22 @@ public int compareTo(TI16Value other) { int lastComparison = 0; TI16Value typedOther = (TI16Value)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); if (lastComparison != 0) { return lastComparison; } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); if (lastComparison != 0) { return lastComparison; } @@ -268,17 +376,35 @@ public String toString() { StringBuilder sb = new StringBuilder("TI16Value("); boolean first = true; - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -292,8 +418,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; 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); @@ -318,10 +442,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value struct) t break; } switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.value = iprot.readI16(); - struct.setValueIsSet(true); + case 1: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); + struct.values = new ArrayList(_list62.size); + for (int _i63 = 0; _i63 < _list62.size; ++_i63) + { + short _elem64; // required + _elem64 = iprot.readI16(); + struct.values.add(_elem64); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -339,9 +481,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Value struct) struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI16(struct.value); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.values.size())); + for (short _iter65 : struct.values) + { + oprot.writeI16(_iter65); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -361,24 +515,32 @@ public TI16ValueTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value 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.writeI16(struct.value); + { + oprot.writeI32(struct.values.size()); + for (short _iter66 : struct.values) + { + oprot.writeI16(_iter66); + } } + oprot.writeBinary(struct.nulls); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI16(); - struct.setValueIsSet(true); + { + org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); + struct.values = new ArrayList(_list67.size); + for (int _i68 = 0; _i68 < _list67.size; ++_i68) + { + short _elem69; // required + _elem69 = iprot.readI16(); + struct.values.add(_elem69); + } } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } } diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI32Value.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI32Value.java index 059408b..e42ca7e 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI32Value.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI32Value.java @@ -34,7 +34,8 @@ public class TI32Value 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("TI32Value"); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,11 +43,13 @@ schemes.put(TupleScheme.class, new TI32ValueTupleSchemeFactory()); } - private int value; // optional + private List values; // required + private ByteBuffer nulls; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); private static final Map byName = new HashMap(); @@ -61,8 +64,10 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VALUE - return VALUE; + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; default: return null; } @@ -103,14 +108,14 @@ public String getFieldName() { } // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - 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.I32))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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(TI32Value.class, metaDataMap); } @@ -118,12 +123,30 @@ public String getFieldName() { public TI32Value() { } + public TI32Value( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + /** * Performs a deep copy on other. */ public TI32Value(TI32Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (Integer other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; + } } public TI32Value deepCopy() { @@ -132,39 +155,95 @@ public TI32Value deepCopy() { @Override public void clear() { - setValueIsSet(false); - this.value = 0; + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(int elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; } - public int getValue() { - return this.value; + public void unsetValues() { + this.values = null; } - public void setValue(int value) { - this.value = value; - setValueIsSet(true); + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; } - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; } - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; } - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case VALUE: + case VALUES: if (value == null) { - unsetValue(); + unsetValues(); } else { - setValue((Integer)value); + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); } break; @@ -173,8 +252,11 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { - case VALUE: - return Integer.valueOf(getValue()); + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); } throw new IllegalStateException(); @@ -187,8 +269,10 @@ public boolean isSet(_Fields field) { } switch (field) { - case VALUE: - return isSetValue(); + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); } throw new IllegalStateException(); } @@ -206,12 +290,21 @@ public boolean equals(TI32Value 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)) + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) return false; - if (this.value != that.value) + if (!this.nulls.equals(that.nulls)) return false; } @@ -222,10 +315,15 @@ public boolean equals(TI32Value that) { public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); return builder.toHashCode(); } @@ -238,12 +336,22 @@ public int compareTo(TI32Value other) { int lastComparison = 0; TI32Value typedOther = (TI32Value)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); if (lastComparison != 0) { return lastComparison; } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); if (lastComparison != 0) { return lastComparison; } @@ -268,17 +376,35 @@ public String toString() { StringBuilder sb = new StringBuilder("TI32Value("); boolean first = true; - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -292,8 +418,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; 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); @@ -318,10 +442,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value struct) t break; } switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.value = iprot.readI32(); - struct.setValueIsSet(true); + case 1: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); + struct.values = new ArrayList(_list70.size); + for (int _i71 = 0; _i71 < _list70.size; ++_i71) + { + int _elem72; // required + _elem72 = iprot.readI32(); + struct.values.add(_elem72); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -339,9 +481,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Value struct) struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI32(struct.value); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.values.size())); + for (int _iter73 : struct.values) + { + oprot.writeI32(_iter73); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -361,24 +515,32 @@ public TI32ValueTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value 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.writeI32(struct.value); + { + oprot.writeI32(struct.values.size()); + for (int _iter74 : struct.values) + { + oprot.writeI32(_iter74); + } } + oprot.writeBinary(struct.nulls); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI32(); - struct.setValueIsSet(true); + { + org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.values = new ArrayList(_list75.size); + for (int _i76 = 0; _i76 < _list75.size; ++_i76) + { + int _elem77; // required + _elem77 = iprot.readI32(); + struct.values.add(_elem77); + } } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } } diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI64Value.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI64Value.java index 9a941cc..43b05df 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI64Value.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TI64Value.java @@ -34,7 +34,8 @@ public class TI64Value 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("TI64Value"); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,11 +43,13 @@ schemes.put(TupleScheme.class, new TI64ValueTupleSchemeFactory()); } - private long value; // optional + private List values; // required + private ByteBuffer nulls; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); private static final Map byName = new HashMap(); @@ -61,8 +64,10 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VALUE - return VALUE; + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; default: return null; } @@ -103,14 +108,14 @@ public String getFieldName() { } // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - 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.I64))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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(TI64Value.class, metaDataMap); } @@ -118,12 +123,30 @@ public String getFieldName() { public TI64Value() { } + public TI64Value( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + /** * Performs a deep copy on other. */ public TI64Value(TI64Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (Long other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; + } } public TI64Value deepCopy() { @@ -132,39 +155,95 @@ public TI64Value deepCopy() { @Override public void clear() { - setValueIsSet(false); - this.value = 0; + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(long elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; } - public long getValue() { - return this.value; + public void unsetValues() { + this.values = null; } - public void setValue(long value) { - this.value = value; - setValueIsSet(true); + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; } - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; } - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; } - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case VALUE: + case VALUES: if (value == null) { - unsetValue(); + unsetValues(); } else { - setValue((Long)value); + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); } break; @@ -173,8 +252,11 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { - case VALUE: - return Long.valueOf(getValue()); + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); } throw new IllegalStateException(); @@ -187,8 +269,10 @@ public boolean isSet(_Fields field) { } switch (field) { - case VALUE: - return isSetValue(); + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); } throw new IllegalStateException(); } @@ -206,12 +290,21 @@ public boolean equals(TI64Value 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)) + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) return false; - if (this.value != that.value) + if (!this.nulls.equals(that.nulls)) return false; } @@ -222,10 +315,15 @@ public boolean equals(TI64Value that) { public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); return builder.toHashCode(); } @@ -238,12 +336,22 @@ public int compareTo(TI64Value other) { int lastComparison = 0; TI64Value typedOther = (TI64Value)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); if (lastComparison != 0) { return lastComparison; } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); if (lastComparison != 0) { return lastComparison; } @@ -268,17 +376,35 @@ public String toString() { StringBuilder sb = new StringBuilder("TI64Value("); boolean first = true; - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -292,8 +418,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; 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); @@ -318,10 +442,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value struct) t break; } switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.value = iprot.readI64(); - struct.setValueIsSet(true); + case 1: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); + struct.values = new ArrayList(_list78.size); + for (int _i79 = 0; _i79 < _list78.size; ++_i79) + { + long _elem80; // required + _elem80 = iprot.readI64(); + struct.values.add(_elem80); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -339,9 +481,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Value struct) struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI64(struct.value); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.values.size())); + for (long _iter81 : struct.values) + { + oprot.writeI64(_iter81); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -361,24 +515,32 @@ public TI64ValueTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value 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.writeI64(struct.value); + { + oprot.writeI32(struct.values.size()); + for (long _iter82 : struct.values) + { + oprot.writeI64(_iter82); + } } + oprot.writeBinary(struct.nulls); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI64(); - struct.setValueIsSet(true); + { + org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.values = new ArrayList(_list83.size); + for (int _i84 = 0; _i84 < _list83.size; ++_i84) + { + long _elem85; // required + _elem85 = iprot.readI64(); + struct.values.add(_elem85); + } } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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..61c989f 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 _map126 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map126.size); + for (int _i127 = 0; _i127 < _map126.size; ++_i127) { - String _key136; // required - String _val137; // required - _key136 = iprot.readString(); - _val137 = iprot.readString(); - struct.configuration.put(_key136, _val137); + String _key128; // required + String _val129; // required + _key128 = iprot.readString(); + _val129 = iprot.readString(); + struct.configuration.put(_key128, _val129); } 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 _iter130 : struct.configuration.entrySet()) { - oprot.writeString(_iter138.getKey()); - oprot.writeString(_iter138.getValue()); + oprot.writeString(_iter130.getKey()); + oprot.writeString(_iter130.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 _iter131 : struct.configuration.entrySet()) { - oprot.writeString(_iter139.getKey()); - oprot.writeString(_iter139.getValue()); + oprot.writeString(_iter131.getKey()); + oprot.writeString(_iter131.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 _map132 = 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*_map132.size); + for (int _i133 = 0; _i133 < _map132.size; ++_i133) { - String _key142; // required - String _val143; // required - _key142 = iprot.readString(); - _val143 = iprot.readString(); - struct.configuration.put(_key142, _val143); + String _key134; // required + String _val135; // required + _key134 = iprot.readString(); + _val135 = iprot.readString(); + struct.configuration.put(_key134, _val135); } } 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 688f790..6b8e0e2 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 _map136 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map136.size); + for (int _i137 = 0; _i137 < _map136.size; ++_i137) { - String _key146; // required - String _val147; // required - _key146 = iprot.readString(); - _val147 = iprot.readString(); - struct.configuration.put(_key146, _val147); + String _key138; // required + String _val139; // required + _key138 = iprot.readString(); + _val139 = iprot.readString(); + struct.configuration.put(_key138, _val139); } 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 _iter140 : struct.configuration.entrySet()) { - oprot.writeString(_iter148.getKey()); - oprot.writeString(_iter148.getValue()); + oprot.writeString(_iter140.getKey()); + oprot.writeString(_iter140.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 _iter141 : struct.configuration.entrySet()) { - oprot.writeString(_iter149.getKey()); - oprot.writeString(_iter149.getValue()); + oprot.writeString(_iter141.getKey()); + oprot.writeString(_iter141.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 _map142 = 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*_map142.size); + for (int _i143 = 0; _i143 < _map142.size; ++_i143) { - String _key152; // required - String _val153; // required - _key152 = iprot.readString(); - _val153 = iprot.readString(); - struct.configuration.put(_key152, _val153); + String _key144; // required + String _val145; // required + _key144 = iprot.readString(); + _val145 = iprot.readString(); + struct.configuration.put(_key144, _val145); } } 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 deleted file mode 100644 index 0b6772c..0000000 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java +++ /dev/null @@ -1,439 +0,0 @@ -/** - * 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 TRow 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("TRow"); - - private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRowStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRowTupleSchemeFactory()); - } - - private List colVals; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COL_VALS((short)1, "colVals"); - - 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: // COL_VALS - return COL_VALS; - 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 - 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.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, - 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, TColumnValue.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); - } - - public TRow() { - } - - public TRow( - List colVals) - { - this(); - this.colVals = colVals; - } - - /** - * Performs a deep copy on other. - */ - public TRow(TRow other) { - if (other.isSetColVals()) { - List __this__colVals = new ArrayList(); - for (TColumnValue other_element : other.colVals) { - __this__colVals.add(new TColumnValue(other_element)); - } - this.colVals = __this__colVals; - } - } - - public TRow deepCopy() { - return new TRow(this); - } - - @Override - public void clear() { - this.colVals = null; - } - - public int getColValsSize() { - return (this.colVals == null) ? 0 : this.colVals.size(); - } - - public java.util.Iterator getColValsIterator() { - return (this.colVals == null) ? null : this.colVals.iterator(); - } - - public void addToColVals(TColumnValue elem) { - if (this.colVals == null) { - this.colVals = new ArrayList(); - } - this.colVals.add(elem); - } - - public List getColVals() { - return this.colVals; - } - - public void setColVals(List colVals) { - this.colVals = colVals; - } - - public void unsetColVals() { - this.colVals = null; - } - - /** Returns true if field colVals is set (has been assigned a value) and false otherwise */ - public boolean isSetColVals() { - return this.colVals != null; - } - - public void setColValsIsSet(boolean value) { - if (!value) { - this.colVals = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COL_VALS: - if (value == null) { - unsetColVals(); - } else { - setColVals((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COL_VALS: - return getColVals(); - - } - 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 COL_VALS: - return isSetColVals(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRow) - return this.equals((TRow)that); - return false; - } - - public boolean equals(TRow that) { - if (that == null) - return false; - - boolean this_present_colVals = true && this.isSetColVals(); - boolean that_present_colVals = true && that.isSetColVals(); - if (this_present_colVals || that_present_colVals) { - if (!(this_present_colVals && that_present_colVals)) - return false; - if (!this.colVals.equals(that.colVals)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_colVals = true && (isSetColVals()); - builder.append(present_colVals); - if (present_colVals) - builder.append(colVals); - - return builder.toHashCode(); - } - - public int compareTo(TRow other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TRow typedOther = (TRow)other; - - lastComparison = Boolean.valueOf(isSetColVals()).compareTo(typedOther.isSetColVals()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColVals()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVals, typedOther.colVals); - 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("TRow("); - boolean first = true; - - sb.append("colVals:"); - if (this.colVals == null) { - sb.append("null"); - } else { - sb.append(this.colVals); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColVals()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'colVals' is unset! Struct:" + toString()); - } - - // 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 TRowStandardSchemeFactory implements SchemeFactory { - public TRowStandardScheme getScheme() { - return new TRowStandardScheme(); - } - } - - private static class TRowStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRow 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: // 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) - { - TColumnValue _elem104; // optional - _elem104 = new TColumnValue(); - _elem104.read(iprot); - struct.colVals.add(_elem104); - } - iprot.readListEnd(); - } - struct.setColValsIsSet(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, TRow struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.colVals != null) { - 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) - { - _iter105.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRowTupleSchemeFactory implements SchemeFactory { - public TRowTupleScheme getScheme() { - return new TRowTupleScheme(); - } - } - - private static class TRowTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.colVals.size()); - for (TColumnValue _iter106 : struct.colVals) - { - _iter106.write(oprot); - } - } - } - - @Override - 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) - { - TColumnValue _elem109; // optional - _elem109 = new TColumnValue(); - _elem109.read(iprot); - struct.colVals.add(_elem109); - } - } - 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..e17a4d2 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 @@ -35,8 +35,7 @@ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -45,14 +44,12 @@ } private long startRowOffset; // required - private List rows; // required - private List columns; // optional + private List colVals; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { START_ROW_OFFSET((short)1, "startRowOffset"), - ROWS((short)2, "rows"), - COLUMNS((short)3, "columns"); + COL_VALS((short)2, "colVals"); private static final Map byName = new HashMap(); @@ -69,10 +66,8 @@ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // START_ROW_OFFSET return START_ROW_OFFSET; - case 2: // ROWS - return ROWS; - case 3: // COLUMNS - return COLUMNS; + case 2: // COL_VALS + return COL_VALS; default: return null; } @@ -115,18 +110,14 @@ public String getFieldName() { // isset id assignments private static final int __STARTROWOFFSET_ISSET_ID = 0; private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.COLUMNS}; 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.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, + tmpMap.put(_Fields.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, 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, TRow.class)))); - tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, - 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, TColumn.class)))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); } @@ -136,12 +127,12 @@ public TRowSet() { public TRowSet( long startRowOffset, - List rows) + List colVals) { this(); this.startRowOffset = startRowOffset; setStartRowOffsetIsSet(true); - this.rows = rows; + this.colVals = colVals; } /** @@ -150,19 +141,12 @@ public TRowSet( public TRowSet(TRowSet other) { __isset_bitfield = other.__isset_bitfield; this.startRowOffset = other.startRowOffset; - if (other.isSetRows()) { - List __this__rows = new ArrayList(); - for (TRow other_element : other.rows) { - __this__rows.add(new TRow(other_element)); - } - this.rows = __this__rows; - } - if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (TColumn other_element : other.columns) { - __this__columns.add(new TColumn(other_element)); + if (other.isSetColVals()) { + List __this__colVals = new ArrayList(); + for (TColumnValue other_element : other.colVals) { + __this__colVals.add(new TColumnValue(other_element)); } - this.columns = __this__columns; + this.colVals = __this__colVals; } } @@ -174,8 +158,7 @@ public TRowSet deepCopy() { public void clear() { setStartRowOffsetIsSet(false); this.startRowOffset = 0; - this.rows = null; - this.columns = null; + this.colVals = null; } public long getStartRowOffset() { @@ -200,79 +183,41 @@ public void setStartRowOffsetIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); } - public int getRowsSize() { - return (this.rows == null) ? 0 : this.rows.size(); + public int getColValsSize() { + return (this.colVals == null) ? 0 : this.colVals.size(); } - public java.util.Iterator getRowsIterator() { - return (this.rows == null) ? null : this.rows.iterator(); + public java.util.Iterator getColValsIterator() { + return (this.colVals == null) ? null : this.colVals.iterator(); } - public void addToRows(TRow elem) { - if (this.rows == null) { - this.rows = new ArrayList(); + public void addToColVals(TColumnValue elem) { + if (this.colVals == null) { + this.colVals = new ArrayList(); } - this.rows.add(elem); + this.colVals.add(elem); } - public List getRows() { - return this.rows; + public List getColVals() { + return this.colVals; } - public void setRows(List rows) { - this.rows = rows; + public void setColVals(List colVals) { + this.colVals = colVals; } - public void unsetRows() { - this.rows = null; + public void unsetColVals() { + this.colVals = null; } - /** Returns true if field rows is set (has been assigned a value) and false otherwise */ - public boolean isSetRows() { - return this.rows != null; + /** Returns true if field colVals is set (has been assigned a value) and false otherwise */ + public boolean isSetColVals() { + return this.colVals != null; } - public void setRowsIsSet(boolean value) { + public void setColValsIsSet(boolean value) { if (!value) { - this.rows = null; - } - } - - public int getColumnsSize() { - return (this.columns == null) ? 0 : this.columns.size(); - } - - public java.util.Iterator getColumnsIterator() { - return (this.columns == null) ? null : this.columns.iterator(); - } - - public void addToColumns(TColumn elem) { - if (this.columns == null) { - this.columns = new ArrayList(); - } - this.columns.add(elem); - } - - public List getColumns() { - return this.columns; - } - - public void setColumns(List columns) { - this.columns = columns; - } - - public void unsetColumns() { - this.columns = null; - } - - /** Returns true if field columns is set (has been assigned a value) and false otherwise */ - public boolean isSetColumns() { - return this.columns != null; - } - - public void setColumnsIsSet(boolean value) { - if (!value) { - this.columns = null; + this.colVals = null; } } @@ -286,19 +231,11 @@ public void setFieldValue(_Fields field, Object value) { } break; - case ROWS: - if (value == null) { - unsetRows(); - } else { - setRows((List)value); - } - break; - - case COLUMNS: + case COL_VALS: if (value == null) { - unsetColumns(); + unsetColVals(); } else { - setColumns((List)value); + setColVals((List)value); } break; @@ -310,11 +247,8 @@ public Object getFieldValue(_Fields field) { case START_ROW_OFFSET: return Long.valueOf(getStartRowOffset()); - case ROWS: - return getRows(); - - case COLUMNS: - return getColumns(); + case COL_VALS: + return getColVals(); } throw new IllegalStateException(); @@ -329,10 +263,8 @@ public boolean isSet(_Fields field) { switch (field) { case START_ROW_OFFSET: return isSetStartRowOffset(); - case ROWS: - return isSetRows(); - case COLUMNS: - return isSetColumns(); + case COL_VALS: + return isSetColVals(); } throw new IllegalStateException(); } @@ -359,21 +291,12 @@ public boolean equals(TRowSet that) { return false; } - boolean this_present_rows = true && this.isSetRows(); - boolean that_present_rows = true && that.isSetRows(); - if (this_present_rows || that_present_rows) { - if (!(this_present_rows && that_present_rows)) - return false; - if (!this.rows.equals(that.rows)) - return false; - } - - boolean this_present_columns = true && this.isSetColumns(); - boolean that_present_columns = true && that.isSetColumns(); - if (this_present_columns || that_present_columns) { - if (!(this_present_columns && that_present_columns)) + boolean this_present_colVals = true && this.isSetColVals(); + boolean that_present_colVals = true && that.isSetColVals(); + if (this_present_colVals || that_present_colVals) { + if (!(this_present_colVals && that_present_colVals)) return false; - if (!this.columns.equals(that.columns)) + if (!this.colVals.equals(that.colVals)) return false; } @@ -389,15 +312,10 @@ public int hashCode() { if (present_startRowOffset) builder.append(startRowOffset); - boolean present_rows = true && (isSetRows()); - builder.append(present_rows); - if (present_rows) - builder.append(rows); - - boolean present_columns = true && (isSetColumns()); - builder.append(present_columns); - if (present_columns) - builder.append(columns); + boolean present_colVals = true && (isSetColVals()); + builder.append(present_colVals); + if (present_colVals) + builder.append(colVals); return builder.toHashCode(); } @@ -420,22 +338,12 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetRows()).compareTo(typedOther.isSetRows()); + lastComparison = Boolean.valueOf(isSetColVals()).compareTo(typedOther.isSetColVals()); if (lastComparison != 0) { return lastComparison; } - if (isSetRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, typedOther.rows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); + if (isSetColVals()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVals, typedOther.colVals); if (lastComparison != 0) { return lastComparison; } @@ -464,23 +372,13 @@ public String toString() { sb.append(this.startRowOffset); first = false; if (!first) sb.append(", "); - sb.append("rows:"); - if (this.rows == null) { + sb.append("colVals:"); + if (this.colVals == null) { sb.append("null"); } else { - sb.append(this.rows); + sb.append(this.colVals); } first = false; - if (isSetColumns()) { - if (!first) sb.append(", "); - sb.append("columns:"); - if (this.columns == null) { - sb.append("null"); - } else { - sb.append(this.columns); - } - first = false; - } sb.append(")"); return sb.toString(); } @@ -491,8 +389,8 @@ public void validate() throws org.apache.thrift.TException { throw new org.apache.thrift.protocol.TProtocolException("Required field 'startRowOffset' is unset! Struct:" + toString()); } - if (!isSetRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); + if (!isSetColVals()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'colVals' is unset! Struct:" + toString()); } // check for sub-struct validity @@ -542,40 +440,21 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) thr org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // ROWS + case 2: // COL_VALS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - struct.rows = new ArrayList(_list110.size); + struct.colVals = new ArrayList(_list110.size); for (int _i111 = 0; _i111 < _list110.size; ++_i111) { - TRow _elem112; // optional - _elem112 = new TRow(); + TColumnValue _elem112; // required + _elem112 = new TColumnValue(); _elem112.read(iprot); - struct.rows.add(_elem112); - } - iprot.readListEnd(); - } - struct.setRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - 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) - { - TColumn _elem115; // optional - _elem115 = new TColumn(); - _elem115.read(iprot); - struct.columns.add(_elem115); + struct.colVals.add(_elem112); } iprot.readListEnd(); } - struct.setColumnsIsSet(true); + struct.setColValsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -596,32 +475,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) th oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC); oprot.writeI64(struct.startRowOffset); oprot.writeFieldEnd(); - if (struct.rows != null) { - oprot.writeFieldBegin(ROWS_FIELD_DESC); + if (struct.colVals != null) { + oprot.writeFieldBegin(COL_VALS_FIELD_DESC); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); - for (TRow _iter116 : struct.rows) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.colVals.size())); + for (TColumnValue _iter113 : struct.colVals) { - _iter116.write(oprot); + _iter113.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } - if (struct.columns != null) { - if (struct.isSetColumns()) { - 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) - { - _iter117.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -641,24 +506,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thr TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI64(struct.startRowOffset); { - oprot.writeI32(struct.rows.size()); - for (TRow _iter118 : struct.rows) + oprot.writeI32(struct.colVals.size()); + for (TColumnValue _iter114 : struct.colVals) { - _iter118.write(oprot); - } - } - BitSet optionals = new BitSet(); - if (struct.isSetColumns()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetColumns()) { - { - oprot.writeI32(struct.columns.size()); - for (TColumn _iter119 : struct.columns) - { - _iter119.write(oprot); - } + _iter114.write(oprot); } } } @@ -669,32 +520,17 @@ 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) - { - TRow _elem122; // optional - _elem122 = new TRow(); - _elem122.read(iprot); - struct.rows.add(_elem122); - } - } - struct.setRowsIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { + 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) { - 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) - { - TColumn _elem125; // optional - _elem125 = new TColumn(); - _elem125.read(iprot); - struct.columns.add(_elem125); - } + TColumnValue _elem117; // required + _elem117 = new TColumnValue(); + _elem117.read(iprot); + struct.colVals.add(_elem117); } - struct.setColumnsIsSet(true); } + struct.setColValsIsSet(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..44c5a96 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 _list118 = iprot.readListBegin(); + struct.infoMessages = new ArrayList(_list118.size); + for (int _i119 = 0; _i119 < _list118.size; ++_i119) { - String _elem128; // optional - _elem128 = iprot.readString(); - struct.infoMessages.add(_elem128); + String _elem120; // required + _elem120 = iprot.readString(); + struct.infoMessages.add(_elem120); } 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 _iter121 : struct.infoMessages) { - oprot.writeString(_iter129); + oprot.writeString(_iter121); } 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 _iter122 : struct.infoMessages) { - oprot.writeString(_iter130); + oprot.writeString(_iter122); } } } @@ -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 _list123 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.infoMessages = new ArrayList(_list123.size); + for (int _i124 = 0; _i124 < _list123.size; ++_i124) { - String _elem133; // optional - _elem133 = iprot.readString(); - struct.infoMessages.add(_elem133); + String _elem125; // required + _elem125 = iprot.readString(); + struct.infoMessages.add(_elem125); } } struct.setInfoMessagesIsSet(true); diff --git service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringValue.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringValue.java index af7a109..5d5aec8 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringValue.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringValue.java @@ -34,7 +34,8 @@ public class TStringValue 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("TStringValue"); - 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 org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,11 +43,13 @@ schemes.put(TupleScheme.class, new TStringValueTupleSchemeFactory()); } - private String value; // optional + private List values; // required + private ByteBuffer nulls; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); private static final Map byName = new HashMap(); @@ -61,8 +64,10 @@ */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VALUE - return VALUE; + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; default: return null; } @@ -103,12 +108,14 @@ public String getFieldName() { } // 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))); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + 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(TStringValue.class, metaDataMap); } @@ -116,12 +123,29 @@ public String getFieldName() { public TStringValue() { } + public TStringValue( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = nulls; + } + /** * Performs a deep copy on other. */ public TStringValue(TStringValue other) { - if (other.isSetValue()) { - this.value = other.value; + if (other.isSetValues()) { + List __this__values = new ArrayList(); + for (String other_element : other.values) { + __this__values.add(other_element); + } + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); +; } } @@ -131,39 +155,95 @@ public TStringValue deepCopy() { @Override public void clear() { - this.value = null; + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); } - public String getValue() { - return this.value; + public void addToValues(String elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; } - public void setValue(String value) { - this.value = value; + public void setValues(List values) { + this.values = values; } - public void unsetValue() { - this.value = null; + public void unsetValues() { + this.values = null; } - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return this.value != null; + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; } - public void setValueIsSet(boolean value) { + public void setValuesIsSet(boolean value) { if (!value) { - this.value = null; + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return nulls; + } + + public void setNulls(byte[] nulls) { + setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = nulls; + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case VALUE: + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: if (value == null) { - unsetValue(); + unsetNulls(); } else { - setValue((String)value); + setNulls((ByteBuffer)value); } break; @@ -172,8 +252,11 @@ public void setFieldValue(_Fields field, Object value) { public Object getFieldValue(_Fields field) { switch (field) { - case VALUE: - return getValue(); + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); } throw new IllegalStateException(); @@ -186,8 +269,10 @@ public boolean isSet(_Fields field) { } switch (field) { - case VALUE: - return isSetValue(); + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); } throw new IllegalStateException(); } @@ -205,12 +290,21 @@ public boolean equals(TStringValue 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)) + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) return false; - if (!this.value.equals(that.value)) + if (!this.nulls.equals(that.nulls)) return false; } @@ -221,10 +315,15 @@ public boolean equals(TStringValue that) { public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); + boolean present_values = true && (isSetValues()); + builder.append(present_values); + if (present_values) + builder.append(values); + + boolean present_nulls = true && (isSetNulls()); + builder.append(present_nulls); + if (present_nulls) + builder.append(nulls); return builder.toHashCode(); } @@ -237,12 +336,22 @@ public int compareTo(TStringValue other) { int lastComparison = 0; TStringValue typedOther = (TStringValue)other; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); if (lastComparison != 0) { return lastComparison; } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); if (lastComparison != 0) { return lastComparison; } @@ -267,21 +376,35 @@ public String toString() { StringBuilder sb = new StringBuilder("TStringValue("); boolean first = true; - if (isSetValue()) { - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + // check for sub-struct validity } @@ -319,10 +442,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue struct break; } switch (schemeField.id) { - case 1: // VALUE + case 1: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); + struct.values = new ArrayList(_list94.size); + for (int _i95 = 0; _i95 < _list94.size; ++_i95) + { + String _elem96; // required + _elem96 = iprot.readString(); + struct.values.add(_elem96); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.value = iprot.readString(); - struct.setValueIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -340,12 +481,22 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringValue struc struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.value != null) { - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeString(struct.value); - oprot.writeFieldEnd(); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (String _iter97 : struct.values) + { + oprot.writeString(_iter97); + } + oprot.writeListEnd(); } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -364,24 +515,32 @@ public TStringValueTupleScheme getScheme() { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue 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.writeString(struct.value); + { + oprot.writeI32(struct.values.size()); + for (String _iter98 : struct.values) + { + oprot.writeString(_iter98); + } } + oprot.writeBinary(struct.nulls); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readString(); - struct.setValueIsSet(true); + { + org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new ArrayList(_list99.size); + for (int _i100 = 0; _i100 < _list99.size; ++_i100) + { + String _elem101; // required + _elem101 = iprot.readString(); + struct.values.add(_elem101); + } } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java index 3935555..4c06c1a 100644 --- service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java +++ service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java @@ -360,7 +360,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers str for (int _i1 = 0; _i1 < _map0.size; ++_i1) { String _key2; // required - TTypeQualifierValue _val3; // required + TTypeQualifierValue _val3; // optional _key2 = iprot.readString(); _val3 = new TTypeQualifierValue(); _val3.read(iprot); @@ -435,7 +435,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers stru for (int _i7 = 0; _i7 < _map6.size; ++_i7) { String _key8; // required - TTypeQualifierValue _val9; // required + TTypeQualifierValue _val9; // optional _key8 = iprot.readString(); _val9 = new TTypeQualifierValue(); _val9.read(iprot); 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 185ea5b..1a7de44 100644 --- service/src/gen/thrift/gen-py/TCLIService/ttypes.py +++ service/src/gen/thrift/gen-py/TCLIService/ttypes.py @@ -1308,16 +1308,19 @@ def __ne__(self, other): class TBoolValue: """ Attributes: - - value + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.BOOL, 'value', None, None, ), # 1 + (1, TType.LIST, 'values', (TType.BOOL,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, value=None,): - self.value = value + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1329,8 +1332,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.BOOL: - self.value = iprot.readBool(); + if ftype == TType.LIST: + self.values = [] + (_etype44, _size41) = iprot.readListBegin() + for _i45 in xrange(_size41): + _elem46 = iprot.readBool(); + self.values.append(_elem46) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1343,14 +1356,25 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('TBoolValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.BOOL, 1) - oprot.writeBool(self.value) + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.BOOL, len(self.values)) + for iter47 in self.values: + oprot.writeBool(iter47) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1368,16 +1392,19 @@ def __ne__(self, other): class TByteValue: """ Attributes: - - value + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.BYTE, 'value', None, None, ), # 1 + (1, TType.LIST, 'values', (TType.BYTE,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, value=None,): - self.value = value + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1389,8 +1416,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.BYTE: - self.value = iprot.readByte(); + if ftype == TType.LIST: + self.values = [] + (_etype51, _size48) = iprot.readListBegin() + for _i52 in xrange(_size48): + _elem53 = iprot.readByte(); + self.values.append(_elem53) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1403,14 +1440,25 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('TByteValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.BYTE, 1) - oprot.writeByte(self.value) + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.BYTE, len(self.values)) + for iter54 in self.values: + oprot.writeByte(iter54) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1428,16 +1476,19 @@ def __ne__(self, other): class TI16Value: """ Attributes: - - value + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.I16, 'value', None, None, ), # 1 + (1, TType.LIST, 'values', (TType.I16,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, value=None,): - self.value = value + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1449,8 +1500,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I16: - self.value = iprot.readI16(); + if ftype == TType.LIST: + self.values = [] + (_etype58, _size55) = iprot.readListBegin() + for _i59 in xrange(_size55): + _elem60 = iprot.readI16(); + self.values.append(_elem60) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1463,14 +1524,25 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('TI16Value') - if self.value is not None: - oprot.writeFieldBegin('value', TType.I16, 1) - oprot.writeI16(self.value) + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.I16, len(self.values)) + for iter61 in self.values: + oprot.writeI16(iter61) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1488,16 +1560,19 @@ def __ne__(self, other): class TI32Value: """ Attributes: - - value + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.I32, 'value', None, None, ), # 1 + (1, TType.LIST, 'values', (TType.I32,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, value=None,): - self.value = value + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1509,8 +1584,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I32: - self.value = iprot.readI32(); + if ftype == TType.LIST: + self.values = [] + (_etype65, _size62) = iprot.readListBegin() + for _i66 in xrange(_size62): + _elem67 = iprot.readI32(); + self.values.append(_elem67) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1523,14 +1608,25 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('TI32Value') - if self.value is not None: - oprot.writeFieldBegin('value', TType.I32, 1) - oprot.writeI32(self.value) + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.I32, len(self.values)) + for iter68 in self.values: + oprot.writeI32(iter68) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1548,16 +1644,19 @@ def __ne__(self, other): class TI64Value: """ Attributes: - - value + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.I64, 'value', None, None, ), # 1 + (1, TType.LIST, 'values', (TType.I64,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, value=None,): - self.value = value + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1569,8 +1668,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I64: - self.value = iprot.readI64(); + if ftype == TType.LIST: + self.values = [] + (_etype72, _size69) = iprot.readListBegin() + for _i73 in xrange(_size69): + _elem74 = iprot.readI64(); + self.values.append(_elem74) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1583,14 +1692,25 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('TI64Value') - if self.value is not None: - oprot.writeFieldBegin('value', TType.I64, 1) - oprot.writeI64(self.value) + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.I64, len(self.values)) + for iter75 in self.values: + oprot.writeI64(iter75) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1608,16 +1728,19 @@ def __ne__(self, other): class TDoubleValue: """ Attributes: - - value + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.DOUBLE, 'value', None, None, ), # 1 + (1, TType.LIST, 'values', (TType.DOUBLE,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, value=None,): - self.value = value + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1629,8 +1752,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.DOUBLE: - self.value = iprot.readDouble(); + if ftype == TType.LIST: + self.values = [] + (_etype79, _size76) = iprot.readListBegin() + for _i80 in xrange(_size76): + _elem81 = iprot.readDouble(); + self.values.append(_elem81) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1643,14 +1776,25 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('TDoubleValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.DOUBLE, 1) - oprot.writeDouble(self.value) + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.DOUBLE, len(self.values)) + for iter82 in self.values: + oprot.writeDouble(iter82) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1668,16 +1812,19 @@ def __ne__(self, other): class TStringValue: """ Attributes: - - value + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.STRING, 'value', None, None, ), # 1 + (1, TType.LIST, 'values', (TType.STRING,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, value=None,): - self.value = value + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1689,8 +1836,18 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: + if ftype == TType.LIST: + self.values = [] + (_etype86, _size83) = iprot.readListBegin() + for _i87 in xrange(_size83): + _elem88 = iprot.readString(); + self.values.append(_elem88) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: if ftype == TType.STRING: - self.value = iprot.readString(); + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1703,14 +1860,25 @@ def write(self, oprot): oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) return oprot.writeStructBegin('TStringValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.STRING, 1) - oprot.writeString(self.value) + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.values)) + for iter89 in self.values: + oprot.writeString(iter89) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1725,37 +1893,22 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -class TColumn: +class TBinaryValue: """ Attributes: - - boolColumn - - byteColumn - - i16Column - - i32Column - - i64Column - - doubleColumn - - stringColumn + - values + - nulls """ thrift_spec = ( None, # 0 - (1, TType.LIST, 'boolColumn', (TType.STRUCT,(TBoolValue, TBoolValue.thrift_spec)), None, ), # 1 - (2, TType.LIST, 'byteColumn', (TType.STRUCT,(TByteValue, TByteValue.thrift_spec)), None, ), # 2 - (3, TType.LIST, 'i16Column', (TType.STRUCT,(TI16Value, TI16Value.thrift_spec)), None, ), # 3 - (4, TType.LIST, 'i32Column', (TType.STRUCT,(TI32Value, TI32Value.thrift_spec)), None, ), # 4 - (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 + (1, TType.LIST, 'values', (TType.STRING,None), None, ), # 1 + (2, TType.STRING, 'nulls', None, None, ), # 2 ) - def __init__(self, boolColumn=None, byteColumn=None, i16Column=None, i32Column=None, i64Column=None, doubleColumn=None, stringColumn=None,): - self.boolColumn = boolColumn - self.byteColumn = byteColumn - self.i16Column = i16Column - self.i32Column = i32Column - self.i64Column = i64Column - self.doubleColumn = doubleColumn - self.stringColumn = stringColumn + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls 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: @@ -1768,79 +1921,17 @@ def read(self, iprot): break if fid == 1: if ftype == TType.LIST: - self.boolColumn = [] - (_etype44, _size41) = iprot.readListBegin() - for _i45 in xrange(_size41): - _elem46 = TBoolValue() - _elem46.read(iprot) - self.boolColumn.append(_elem46) + self.values = [] + (_etype93, _size90) = iprot.readListBegin() + for _i94 in xrange(_size90): + _elem95 = iprot.readString(); + self.values.append(_elem95) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.LIST: - self.byteColumn = [] - (_etype50, _size47) = iprot.readListBegin() - for _i51 in xrange(_size47): - _elem52 = TByteValue() - _elem52.read(iprot) - self.byteColumn.append(_elem52) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.LIST: - self.i16Column = [] - (_etype56, _size53) = iprot.readListBegin() - for _i57 in xrange(_size53): - _elem58 = TI16Value() - _elem58.read(iprot) - self.i16Column.append(_elem58) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.LIST: - self.i32Column = [] - (_etype62, _size59) = iprot.readListBegin() - for _i63 in xrange(_size59): - _elem64 = TI32Value() - _elem64.read(iprot) - self.i32Column.append(_elem64) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.LIST: - self.i64Column = [] - (_etype68, _size65) = iprot.readListBegin() - for _i69 in xrange(_size65): - _elem70 = TI64Value() - _elem70.read(iprot) - self.i64Column.append(_elem70) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.LIST: - self.doubleColumn = [] - (_etype74, _size71) = iprot.readListBegin() - for _i75 in xrange(_size71): - _elem76 = TDoubleValue() - _elem76.read(iprot) - self.doubleColumn.append(_elem76) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.LIST: - self.stringColumn = [] - (_etype80, _size77) = iprot.readListBegin() - for _i81 in xrange(_size77): - _elem82 = TStringValue() - _elem82.read(iprot) - self.stringColumn.append(_elem82) - iprot.readListEnd() + if ftype == TType.STRING: + self.nulls = iprot.readString(); else: iprot.skip(ftype) else: @@ -1852,60 +1943,26 @@ 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('TColumn') - 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) + oprot.writeStructBegin('TBinaryValue') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.values)) + for iter96 in self.values: + oprot.writeString(iter96) 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) - 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) - 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) - 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) - 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) - 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) - oprot.writeListEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeString(self.nulls) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): + if self.values is None: + raise TProtocol.TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocol.TProtocolException(message='Required field nulls is unset!') return @@ -1930,6 +1987,7 @@ class TColumnValue: - i64Val - doubleVal - stringVal + - binaryVal """ thrift_spec = ( @@ -1941,9 +1999,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 @@ -1951,6 +2010,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: @@ -2003,6 +2063,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() @@ -2041,81 +2107,14 @@ def write(self, oprot): oprot.writeFieldBegin('stringVal', TType.STRUCT, 7) self.stringVal.write(oprot) 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 TRow: - """ - Attributes: - - colVals - """ - - thrift_spec = ( - None, # 0 - (1, TType.LIST, 'colVals', (TType.STRUCT,(TColumnValue, TColumnValue.thrift_spec)), None, ), # 1 - ) - - def __init__(self, colVals=None,): - self.colVals = colVals - - 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.LIST: - self.colVals = [] - (_etype93, _size90) = iprot.readListBegin() - for _i94 in xrange(_size90): - _elem95 = TColumnValue() - _elem95.read(iprot) - self.colVals.append(_elem95) - iprot.readListEnd() - 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('TRow') - 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) - oprot.writeListEnd() + if self.binaryVal is not None: + oprot.writeFieldBegin('binaryVal', TType.STRUCT, 8) + self.binaryVal.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() def validate(self): - if self.colVals is None: - raise TProtocol.TProtocolException(message='Required field colVals is unset!') return @@ -2134,21 +2133,18 @@ class TRowSet: """ Attributes: - startRowOffset - - rows - - columns + - colVals """ thrift_spec = ( None, # 0 (1, TType.I64, 'startRowOffset', None, None, ), # 1 - (2, TType.LIST, 'rows', (TType.STRUCT,(TRow, TRow.thrift_spec)), None, ), # 2 - (3, TType.LIST, 'columns', (TType.STRUCT,(TColumn, TColumn.thrift_spec)), None, ), # 3 + (2, TType.LIST, 'colVals', (TType.STRUCT,(TColumnValue, TColumnValue.thrift_spec)), None, ), # 2 ) - def __init__(self, startRowOffset=None, rows=None, columns=None,): + def __init__(self, startRowOffset=None, colVals=None,): self.startRowOffset = startRowOffset - self.rows = rows - self.columns = columns + self.colVals = colVals 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: @@ -2166,23 +2162,12 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: - self.rows = [] + self.colVals = [] (_etype100, _size97) = iprot.readListBegin() for _i101 in xrange(_size97): - _elem102 = TRow() + _elem102 = TColumnValue() _elem102.read(iprot) - self.rows.append(_elem102) - 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) + self.colVals.append(_elem102) iprot.readListEnd() else: iprot.skip(ftype) @@ -2200,18 +2185,11 @@ def write(self, oprot): oprot.writeFieldBegin('startRowOffset', TType.I64, 1) oprot.writeI64(self.startRowOffset) oprot.writeFieldEnd() - 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) - 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) + if self.colVals is not None: + oprot.writeFieldBegin('colVals', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.colVals)) + for iter103 in self.colVals: + iter103.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2220,8 +2198,8 @@ def write(self, oprot): def validate(self): if self.startRowOffset is None: raise TProtocol.TProtocolException(message='Required field startRowOffset is unset!') - if self.rows is None: - raise TProtocol.TProtocolException(message='Required field rows is unset!') + if self.colVals is None: + raise TProtocol.TProtocolException(message='Required field colVals is unset!') return @@ -2279,10 +2257,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) + (_etype107, _size104) = iprot.readListBegin() + for _i108 in xrange(_size104): + _elem109 = iprot.readString(); + self.infoMessages.append(_elem109) iprot.readListEnd() else: iprot.skip(ftype) @@ -2318,8 +2296,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 iter110 in self.infoMessages: + oprot.writeString(iter110) oprot.writeListEnd() oprot.writeFieldEnd() if self.sqlState is not None: @@ -2646,11 +2624,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 + (_ktype112, _vtype113, _size111 ) = iprot.readMapBegin() + for _i115 in xrange(_size111): + _key116 = iprot.readString(); + _val117 = iprot.readString(); + self.configuration[_key116] = _val117 iprot.readMapEnd() else: iprot.skip(ftype) @@ -2679,9 +2657,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 kiter118,viter119 in self.configuration.items(): + oprot.writeString(kiter118) + oprot.writeString(viter119) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2756,11 +2734,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 + (_ktype121, _vtype122, _size120 ) = iprot.readMapBegin() + for _i124 in xrange(_size120): + _key125 = iprot.readString(); + _val126 = iprot.readString(); + self.configuration[_key125] = _val126 iprot.readMapEnd() else: iprot.skip(ftype) @@ -2789,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 kiter134,viter135 in self.configuration.items(): - oprot.writeString(kiter134) - oprot.writeString(viter135) + for kiter127,viter128 in self.configuration.items(): + oprot.writeString(kiter127) + oprot.writeString(viter128) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -3263,11 +3241,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 + (_ktype130, _vtype131, _size129 ) = iprot.readMapBegin() + for _i133 in xrange(_size129): + _key134 = iprot.readString(); + _val135 = iprot.readString(); + self.confOverlay[_key134] = _val135 iprot.readMapEnd() else: iprot.skip(ftype) @@ -3297,9 +3275,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 kiter136,viter137 in self.confOverlay.items(): + oprot.writeString(kiter136) + oprot.writeString(viter137) oprot.writeMapEnd() oprot.writeFieldEnd() if self.runAsync is not None: @@ -3904,10 +3882,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) + (_etype141, _size138) = iprot.readListBegin() + for _i142 in xrange(_size138): + _elem143 = iprot.readString(); + self.tableTypes.append(_elem143) iprot.readListEnd() else: iprot.skip(ftype) @@ -3940,8 +3918,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 iter144 in self.tableTypes: + oprot.writeString(iter144) 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 c94acbf..f105890 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 @@ -410,15 +410,19 @@ end class TBoolValue include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 + VALUES = 1 + NULLS = 2 FIELDS = { - VALUE => {:type => ::Thrift::Types::BOOL, :name => 'value', :optional => true} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BOOL}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end ::Thrift::Struct.generate_accessors self @@ -426,15 +430,19 @@ end class TByteValue include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 + VALUES = 1 + NULLS = 2 FIELDS = { - VALUE => {:type => ::Thrift::Types::BYTE, :name => 'value', :optional => true} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BYTE}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end ::Thrift::Struct.generate_accessors self @@ -442,15 +450,19 @@ end class TI16Value include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 + VALUES = 1 + NULLS = 2 FIELDS = { - VALUE => {:type => ::Thrift::Types::I16, :name => 'value', :optional => true} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I16}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end ::Thrift::Struct.generate_accessors self @@ -458,15 +470,19 @@ end class TI32Value include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 + VALUES = 1 + NULLS = 2 FIELDS = { - VALUE => {:type => ::Thrift::Types::I32, :name => 'value', :optional => true} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I32}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end ::Thrift::Struct.generate_accessors self @@ -474,15 +490,19 @@ end class TI64Value include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 + VALUES = 1 + NULLS = 2 FIELDS = { - VALUE => {:type => ::Thrift::Types::I64, :name => 'value', :optional => true} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I64}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end ::Thrift::Struct.generate_accessors self @@ -490,15 +510,19 @@ end class TDoubleValue include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 + VALUES = 1 + NULLS = 2 FIELDS = { - VALUE => {:type => ::Thrift::Types::DOUBLE, :name => 'value', :optional => true} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::DOUBLE}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end ::Thrift::Struct.generate_accessors self @@ -506,77 +530,42 @@ end class TStringValue include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 + VALUES = 1 + NULLS = 2 FIELDS = { - VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :optional => true} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end ::Thrift::Struct.generate_accessors self end -class TColumn < ::Thrift::Union - include ::Thrift::Struct_Union - class << self - def boolColumn(val) - TColumn.new(:boolColumn, val) - end - - def byteColumn(val) - TColumn.new(:byteColumn, val) - end - - def i16Column(val) - TColumn.new(:i16Column, val) - end - - def i32Column(val) - TColumn.new(:i32Column, val) - end - - def i64Column(val) - TColumn.new(:i64Column, val) - end - - def doubleColumn(val) - TColumn.new(:doubleColumn, val) - end - - def stringColumn(val) - TColumn.new(:stringColumn, val) - end - end - - BOOLCOLUMN = 1 - BYTECOLUMN = 2 - I16COLUMN = 3 - I32COLUMN = 4 - I64COLUMN = 5 - DOUBLECOLUMN = 6 - STRINGCOLUMN = 7 +class TBinaryValue + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 FIELDS = { - BOOLCOLUMN => {:type => ::Thrift::Types::LIST, :name => 'boolColumn', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TBoolValue}}, - BYTECOLUMN => {:type => ::Thrift::Types::LIST, :name => 'byteColumn', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TByteValue}}, - I16COLUMN => {:type => ::Thrift::Types::LIST, :name => 'i16Column', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TI16Value}}, - 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}} + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING, :binary => true}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} } def struct_fields; FIELDS; end def validate - raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls end - ::Thrift::Union.generate_accessors self + ::Thrift::Struct.generate_accessors self end class TColumnValue < ::Thrift::Union @@ -609,6 +598,10 @@ class TColumnValue < ::Thrift::Union def stringVal(val) TColumnValue.new(:stringVal, val) end + + def binaryVal(val) + TColumnValue.new(:binaryVal, val) + end end BOOLVAL = 1 @@ -618,6 +611,7 @@ class TColumnValue < ::Thrift::Union I64VAL = 5 DOUBLEVAL = 6 STRINGVAL = 7 + BINARYVAL = 8 FIELDS = { BOOLVAL => {:type => ::Thrift::Types::STRUCT, :name => 'boolVal', :class => ::TBoolValue}, @@ -626,7 +620,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 @@ -638,40 +633,21 @@ class TColumnValue < ::Thrift::Union ::Thrift::Union.generate_accessors self end -class TRow - include ::Thrift::Struct, ::Thrift::Struct_Union - COLVALS = 1 - - FIELDS = { - COLVALS => {:type => ::Thrift::Types::LIST, :name => 'colVals', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumnValue}} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field colVals is unset!') unless @colVals - end - - ::Thrift::Struct.generate_accessors self -end - class TRowSet include ::Thrift::Struct, ::Thrift::Struct_Union STARTROWOFFSET = 1 - ROWS = 2 - COLUMNS = 3 + COLVALS = 2 FIELDS = { STARTROWOFFSET => {:type => ::Thrift::Types::I64, :name => 'startRowOffset'}, - ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TRow}}, - COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumn}, :optional => true} + COLVALS => {:type => ::Thrift::Types::LIST, :name => 'colVals', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumnValue}} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startRowOffset is unset!') unless @startRowOffset - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field rows is unset!') unless @rows + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field colVals is unset!') unless @colVals end ::Thrift::Struct.generate_accessors self diff --git service/src/java/org/apache/hive/service/cli/ColumnValue.java service/src/java/org/apache/hive/service/cli/ColumnValue.java index cf2b3d9..d0a9cc6 100644 --- service/src/java/org/apache/hive/service/cli/ColumnValue.java +++ service/src/java/org/apache/hive/service/cli/ColumnValue.java @@ -18,12 +18,20 @@ package org.apache.hive.service.cli; -import java.sql.Date; -import java.sql.Timestamp; +import java.nio.ByteBuffer; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; +import java.util.List; -import org.apache.hadoop.hive.common.type.HiveChar; -import org.apache.hadoop.hive.common.type.HiveDecimal; -import org.apache.hadoop.hive.common.type.HiveVarchar; +import com.google.common.primitives.Booleans; +import com.google.common.primitives.Bytes; +import com.google.common.primitives.Doubles; +import com.google.common.primitives.Ints; +import com.google.common.primitives.Longs; +import com.google.common.primitives.Shorts; +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; @@ -35,173 +43,381 @@ /** * ColumnValue. - * */ -public class ColumnValue { +public class ColumnValue extends AbstractList { - public static final TColumnValue NULL = new TColumnValue(); + private static final int DEFAULT_SIZE = 100; - static { - NULL.setStringVal(new TStringValue()); - } + private final Type type; - // TODO: replace this with a non-Thrift implementation - private final TColumnValue tColumnValue; + private BitSet nulls; - public ColumnValue(TColumnValue tColumnValue) { - this.tColumnValue = new TColumnValue(tColumnValue); - } + private int size; + private boolean[] boolVars; + private byte[] byteVars; + private short[] shortVars; + private int[] intVars; + private long[] longVars; + private double[] doubleVars; + private List stringVars; + private List binaryVars; - private static boolean isNull(Object value) { - return (value == null); + public ColumnValue(Type type, BitSet nulls, Object values) { + this.type = type; + this.nulls = nulls; + if (type == Type.BOOLEAN_TYPE) { + boolVars = (boolean[]) values; + size = boolVars.length; + } else if (type == Type.TINYINT_TYPE) { + byteVars = (byte[]) values; + size = byteVars.length; + } else if (type == Type.SMALLINT_TYPE) { + shortVars = (short[]) values; + size = shortVars.length; + } else if (type == Type.INT_TYPE) { + intVars = (int[]) values; + size = intVars.length; + } else if (type == Type.BIGINT_TYPE) { + longVars = (long[]) values; + size = longVars.length; + } else if (type == Type.DOUBLE_TYPE) { + doubleVars = (double[]) values; + size = doubleVars.length; + } else if (type == Type.BINARY_TYPE) { + binaryVars = (List) values; + size = binaryVars.size(); + } else if (type == Type.STRING_TYPE) { + stringVars = (List) values; + size = stringVars.size(); + } else { + throw new IllegalStateException("invalid union object"); + } } - public static ColumnValue booleanValue(Boolean value) { - TBoolValue tBoolValue = new TBoolValue(); - if (value != null) { - tBoolValue.setValue(value); + public ColumnValue(Type type) { + nulls = new BitSet(); + switch (type) { + case BOOLEAN_TYPE: + boolVars = new boolean[DEFAULT_SIZE]; + break; + case TINYINT_TYPE: + byteVars = new byte[DEFAULT_SIZE]; + break; + case SMALLINT_TYPE: + shortVars = new short[DEFAULT_SIZE]; + break; + case INT_TYPE: + intVars = new int[DEFAULT_SIZE]; + break; + case BIGINT_TYPE: + longVars = new long[DEFAULT_SIZE]; + break; + case FLOAT_TYPE: + case DOUBLE_TYPE: + type = Type.DOUBLE_TYPE; + doubleVars = new double[DEFAULT_SIZE]; + break; + case BINARY_TYPE: + binaryVars = new ArrayList(); + break; + default: + type = Type.STRING_TYPE; + stringVars = new ArrayList(); } - return new ColumnValue(TColumnValue.boolVal(tBoolValue)); + this.type = type; } - public static ColumnValue byteValue(Byte value) { - TByteValue tByteValue = new TByteValue(); - if (value != null) { - tByteValue.setValue(value); + public ColumnValue(TColumnValue colValues) { + if (colValues.isSetBoolVal()) { + type = Type.BOOLEAN_TYPE; + nulls = toBitset(colValues.getBoolVal().getNulls()); + boolVars = Booleans.toArray(colValues.getBoolVal().getValues()); + size = boolVars.length; + } else if (colValues.isSetByteVal()) { + type = Type.TINYINT_TYPE; + nulls = toBitset(colValues.getByteVal().getNulls()); + byteVars = Bytes.toArray(colValues.getByteVal().getValues()); + size = byteVars.length; + } else if (colValues.isSetI16Val()) { + type = Type.SMALLINT_TYPE; + nulls = toBitset(colValues.getI16Val().getNulls()); + shortVars = Shorts.toArray(colValues.getI16Val().getValues()); + size = shortVars.length; + } else if (colValues.isSetI32Val()) { + type = Type.INT_TYPE; + nulls = toBitset(colValues.getI32Val().getNulls()); + intVars = Ints.toArray(colValues.getI32Val().getValues()); + size = intVars.length; + } else if (colValues.isSetI64Val()) { + type = Type.BIGINT_TYPE; + nulls = toBitset(colValues.getI64Val().getNulls()); + longVars = Longs.toArray(colValues.getI64Val().getValues()); + size = longVars.length; + } else if (colValues.isSetDoubleVal()) { + type = Type.DOUBLE_TYPE; + nulls = toBitset(colValues.getDoubleVal().getNulls()); + doubleVars = Doubles.toArray(colValues.getDoubleVal().getValues()); + size = doubleVars.length; + } else if (colValues.isSetBinaryVal()) { + type = Type.BINARY_TYPE; + nulls = toBitset(colValues.getBinaryVal().getNulls()); + binaryVars = colValues.getBinaryVal().getValues(); + size = binaryVars.size(); + } else if (colValues.isSetStringVal()) { + type = Type.STRING_TYPE; + nulls = toBitset(colValues.getStringVal().getNulls()); + stringVars = colValues.getStringVal().getValues(); + size = stringVars.size(); + } else { + throw new IllegalStateException("invalid union object"); } - return new ColumnValue(TColumnValue.byteVal(tByteValue)); } - public static ColumnValue shortValue(Short value) { - TI16Value tI16Value = new TI16Value(); - if (value != null) { - tI16Value.setValue(value); + public ColumnValue extractSubset(int start, int end) { + BitSet subNulls = nulls.get(start, end); + if (type == Type.BOOLEAN_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, Arrays.copyOfRange(boolVars, start, end)); + boolVars = Arrays.copyOfRange(boolVars, end, size); + nulls = nulls.get(start, size); + size = boolVars.length; + return subset; + } + if (type == Type.TINYINT_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, Arrays.copyOfRange(byteVars, start, end)); + byteVars = Arrays.copyOfRange(byteVars, end, size); + nulls = nulls.get(start, size); + size = byteVars.length; + return subset; + } + if (type == Type.SMALLINT_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, Arrays.copyOfRange(shortVars, start, end)); + shortVars = Arrays.copyOfRange(shortVars, end, size); + nulls = nulls.get(start, size); + size = shortVars.length; + return subset; } - return new ColumnValue(TColumnValue.i16Val(tI16Value)); + if (type == Type.INT_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, Arrays.copyOfRange(intVars, start, end)); + intVars = Arrays.copyOfRange(intVars, end, size); + nulls = nulls.get(start, size); + size = intVars.length; + return subset; + } + if (type == Type.BIGINT_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, Arrays.copyOfRange(longVars, start, end)); + longVars = Arrays.copyOfRange(longVars, end, size); + nulls = nulls.get(start, size); + size = longVars.length; + return subset; + } + if (type == Type.DOUBLE_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, Arrays.copyOfRange(doubleVars, start, end)); + doubleVars = Arrays.copyOfRange(doubleVars, end, size); + nulls = nulls.get(start, size); + size = doubleVars.length; + return subset; + } + if (type == Type.BINARY_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, binaryVars.subList(start, end)); + binaryVars = binaryVars.subList(end, binaryVars.size()); + nulls = nulls.get(start, size); + size = binaryVars.size(); + return subset; + } + if (type == Type.STRING_TYPE) { + ColumnValue subset = new ColumnValue(type, subNulls, stringVars.subList(start, end)); + stringVars = stringVars.subList(end, stringVars.size()); + nulls = nulls.get(start, size); + size = stringVars.size(); + return subset; + } + throw new IllegalStateException("invalid union object"); } - public static ColumnValue intValue(Integer value) { - TI32Value tI32Value = new TI32Value(); - if (value != null) { - tI32Value.setValue(value); + private static final byte[] MASKS = new byte[] { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, (byte)0x80 + }; + + private static BitSet toBitset(byte[] nulls) { + BitSet bitset = new BitSet(); + int bits = nulls.length * 8; + for (int i = 0; i < bits; i++) { + bitset.set(i, (nulls[i / 8] & MASKS[i % 8]) != 0); } - return new ColumnValue(TColumnValue.i32Val(tI32Value)); + return bitset; } - public static ColumnValue longValue(Long value) { - TI64Value tI64Value = new TI64Value(); - if (value != null) { - tI64Value.setValue(value); + private static byte[] toBinary(BitSet bitset) { + byte[] nulls = new byte[1 + (bitset.length() / 8)]; + for (int i = 0; i < bitset.length(); i++) { + nulls[i / 8] |= bitset.get(i) ? MASKS[i % 8] : 0; } - return new ColumnValue(TColumnValue.i64Val(tI64Value)); + return nulls; } - public static ColumnValue floatValue(Float value) { - TDoubleValue tDoubleValue = new TDoubleValue(); - if (value != null) { - tDoubleValue.setValue(value); - } - return new ColumnValue(TColumnValue.doubleVal(tDoubleValue)); + public Type getType() { + return type; } - public static ColumnValue doubleValue(Double value) { - TDoubleValue tDoubleValue = new TDoubleValue(); - if (value != null) { - tDoubleValue.setValue(value); + @Override + public Object get(int index) { + if (nulls.get(index)) { + return null; + } + switch (type) { + case BOOLEAN_TYPE: + return boolVars[index]; + case TINYINT_TYPE: + return byteVars[index]; + case SMALLINT_TYPE: + return shortVars[index]; + case INT_TYPE: + return intVars[index]; + case BIGINT_TYPE: + return longVars[index]; + case DOUBLE_TYPE: + return doubleVars[index]; + case STRING_TYPE: + return stringVars.get(index); + case BINARY_TYPE: + return binaryVars.get(index); } - return new ColumnValue(TColumnValue.doubleVal(tDoubleValue)); + return null; } - public static ColumnValue stringValue(String value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value); - } - return new ColumnValue(TColumnValue.stringVal(tStringValue)); + @Override + public int size() { + return size; } - public static ColumnValue stringValue(HiveChar value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); + public TColumnValue toTColumnValue() { + TColumnValue value = new TColumnValue(); + ByteBuffer nullMasks = ByteBuffer.wrap(toBinary(nulls)); + switch (type) { + case BOOLEAN_TYPE: + value.setBoolVal(new TBoolValue(Booleans.asList(Arrays.copyOfRange(boolVars, 0, size)), nullMasks)); + break; + case TINYINT_TYPE: + value.setByteVal(new TByteValue(Bytes.asList(Arrays.copyOfRange(byteVars, 0, size)), nullMasks)); + break; + case SMALLINT_TYPE: + value.setI16Val(new TI16Value(Shorts.asList(Arrays.copyOfRange(shortVars, 0, size)), nullMasks)); + break; + case INT_TYPE: + value.setI32Val(new TI32Value(Ints.asList(Arrays.copyOfRange(intVars, 0, size)), nullMasks)); + break; + case BIGINT_TYPE: + value.setI64Val(new TI64Value(Longs.asList(Arrays.copyOfRange(longVars, 0, size)), nullMasks)); + break; + case DOUBLE_TYPE: + value.setDoubleVal(new TDoubleValue(Doubles.asList(Arrays.copyOfRange(doubleVars, 0, size)), nullMasks)); + break; + case STRING_TYPE: + value.setStringVal(new TStringValue(stringVars, nullMasks)); + break; + case BINARY_TYPE: + value.setBinaryVal(new TBinaryValue(binaryVars, nullMasks)); + break; } - return new ColumnValue(TColumnValue.stringVal(tStringValue)); + return value; } - public static ColumnValue stringValue(HiveVarchar value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); + private static final ByteBuffer EMPTY_BINARY = ByteBuffer.allocate(0); + private static final String EMPTY_STRING = ""; + + public void addValue(Type type, Object field) { + switch (type) { + case BOOLEAN_TYPE: + nulls.set(size, field == null); + boolVars()[size] = field == null ? true : (Boolean)field; + break; + case TINYINT_TYPE: + nulls.set(size, field == null); + byteVars()[size] = field == null ? 0 : (Byte) field; + break; + case SMALLINT_TYPE: + nulls.set(size, field == null); + shortVars()[size] = field == null ? 0 : (Short)field; + break; + case INT_TYPE: + nulls.set(size, field == null); + intVars()[size] = field == null ? 0 : (Integer)field; + break; + case BIGINT_TYPE: + nulls.set(size, field == null); + longVars()[size] = field == null ? 0 : (Long)field; + break; + case FLOAT_TYPE: + nulls.set(size, field == null); + doubleVars()[size] = field == null ? 0 : ((Float)field).doubleValue(); + break; + case DOUBLE_TYPE: + nulls.set(size, field == null); + doubleVars()[size] = field == null ? 0 : (Double)field; + break; + case BINARY_TYPE: + nulls.set(binaryVars.size(), field == null); + binaryVars.add(field == null ? EMPTY_BINARY : ByteBuffer.wrap((byte[])field)); + break; + default: + nulls.set(stringVars.size(), field == null); + stringVars.add(field == null ? EMPTY_STRING : String.valueOf(field)); + break; } - return new ColumnValue(TColumnValue.stringVal(tStringValue)); + size++; } - public static ColumnValue dateValue(Date value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); + private boolean[] boolVars() { + if (boolVars.length == size) { + boolean[] newVars = new boolean[size << 1]; + System.arraycopy(boolVars, 0, newVars, 0, size); + return boolVars = newVars; } - return new ColumnValue(TColumnValue.stringVal(tStringValue)); + return boolVars; } - public static ColumnValue timestampValue(Timestamp value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); + private byte[] byteVars() { + if (byteVars.length == size) { + byte[] newVars = new byte[size << 1]; + System.arraycopy(byteVars, 0, newVars, 0, size); + return byteVars = newVars; } - return new ColumnValue(TColumnValue.stringVal(tStringValue)); + return byteVars; } - public static ColumnValue stringValue(HiveDecimal value) { - TStringValue tStrValue = new TStringValue(); - if (value != null) { - tStrValue.setValue(value.toString()); + private short[] shortVars() { + if (shortVars.length == size) { + short[] newVars = new short[size << 1]; + System.arraycopy(shortVars, 0, newVars, 0, size); + return shortVars = newVars; } - return new ColumnValue(TColumnValue.stringVal(tStrValue)); + return shortVars; } - public static ColumnValue newColumnValue(Type type, Object value) { - switch (type) { - case BOOLEAN_TYPE: - return booleanValue((Boolean)value); - case TINYINT_TYPE: - return byteValue((Byte)value); - case SMALLINT_TYPE: - return shortValue((Short)value); - case INT_TYPE: - return intValue((Integer)value); - case BIGINT_TYPE: - return longValue((Long)value); - case FLOAT_TYPE: - return floatValue((Float)value); - case DOUBLE_TYPE: - return doubleValue((Double)value); - case STRING_TYPE: - return stringValue((String)value); - case CHAR_TYPE: - return stringValue((HiveChar)value); - case VARCHAR_TYPE: - return stringValue((HiveVarchar)value); - case DATE_TYPE: - return dateValue((Date)value); - case TIMESTAMP_TYPE: - return timestampValue((Timestamp)value); - case DECIMAL_TYPE: - return stringValue(((HiveDecimal)value)); - case BINARY_TYPE: - case ARRAY_TYPE: - case MAP_TYPE: - case STRUCT_TYPE: - case UNION_TYPE: - case USER_DEFINED_TYPE: - return stringValue((String)value); - default: - return null; + private int[] intVars() { + if (intVars.length == size) { + int[] newVars = new int[size << 1]; + System.arraycopy(intVars, 0, newVars, 0, size); + return intVars = newVars; } + return intVars; } - public TColumnValue toTColumnValue() { - return new TColumnValue(tColumnValue); + private long[] longVars() { + if (longVars.length == size) { + long[] newVars = new long[size << 1]; + System.arraycopy(longVars, 0, newVars, 0, size); + return longVars = newVars; + } + return longVars; } + private double[] doubleVars() { + if (doubleVars.length == size) { + double[] newVars = new double[size << 1]; + System.arraycopy(doubleVars, 0, newVars, 0, size); + return doubleVars = newVars; + } + return doubleVars; + } } diff --git service/src/java/org/apache/hive/service/cli/Row.java service/src/java/org/apache/hive/service/cli/Row.java deleted file mode 100644 index 9e419e9..0000000 --- service/src/java/org/apache/hive/service/cli/Row.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.hive.service.cli; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.hive.service.cli.thrift.TColumnValue; -import org.apache.hive.service.cli.thrift.TRow; - -/** - * Row. - * - */ -public class Row { - private final List values = new ArrayList(); - - public Row() { - } - - public Row(TRow tRow) { - for (TColumnValue tColumnValues : tRow.getColVals()) { - values.add(new ColumnValue(tColumnValues)); - } - } - - public Row(TableSchema schema, Object[] fields) { - assert fields.length == schema.getColumnDescriptors().size(); - for (ColumnDescriptor colDesc : schema.getColumnDescriptors()) { - TypeDescriptor typeDesc = colDesc.getTypeDescriptor(); - values.add(ColumnValue.newColumnValue(typeDesc.getType(), fields[colDesc.getOrdinalPosition() - 1])); - } - } - - public Row addColumnValue(ColumnValue value) { - values.add(value); - return this; - } - - public Row addBoolean(boolean value) { - values.add(ColumnValue.booleanValue(value)); - return this; - } - - public Row addByte(byte value) { - values.add(ColumnValue.byteValue(value)); - return this; - } - - public Row addString(String value) { - values.add(ColumnValue.stringValue(value)); - return this; - } - - public TRow toTRow() { - TRow tRow = new TRow(); - for (ColumnValue columnValue : values) { - if (columnValue != null) { - tRow.addToColVals(columnValue.toTColumnValue()); - } else { - tRow.addToColVals(ColumnValue.NULL); - } - } - return tRow; - } -} diff --git service/src/java/org/apache/hive/service/cli/RowSet.java service/src/java/org/apache/hive/service/cli/RowSet.java index dce506d..99a1000 100644 --- service/src/java/org/apache/hive/service/cli/RowSet.java +++ service/src/java/org/apache/hive/service/cli/RowSet.java @@ -18,55 +18,103 @@ package org.apache.hive.service.cli; +import java.math.BigDecimal; +import java.nio.ByteBuffer; +import java.sql.Date; +import java.sql.Timestamp; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; -import org.apache.hive.service.cli.thrift.TRow; +import org.apache.hive.service.cli.thrift.TColumnValue; import org.apache.hive.service.cli.thrift.TRowSet; /** * RowSet. * */ -public class RowSet { +public class RowSet implements Iterable { - private long startOffset = 0; - private boolean hasMoreResults = false; - private List rows; + private long startOffset; - public RowSet() { - rows = new ArrayList(); + private final List types; + private final List values; + + public RowSet(TableSchema schema) { + types = new ArrayList(); + values = new ArrayList(); + for (ColumnDescriptor colDesc : schema.getColumnDescriptors()) { + types.add(colDesc.getType()); + values.add(new ColumnValue(colDesc.getType())); + } + } + + public RowSet(List types, List values, long startOffset) { + this.types = types; + this.values = values; + this.startOffset = startOffset; } public RowSet(TRowSet tRowSet) { - this(); startOffset = tRowSet.getStartRowOffset(); - for (TRow tRow : tRowSet.getRows()) { - rows.add(new Row(tRow)); + types = new ArrayList(); + values = new ArrayList(); + for (TColumnValue tvalue : tRowSet.getColVals()) { + ColumnValue value = new ColumnValue(tvalue); + values.add(value); + types.add(value.getType()); } } - public RowSet(List rows, long startOffset) { - this(); - this.rows.addAll(rows); - this.startOffset = startOffset; + public RowSet addRow(Object[] fields) { + for (int i = 0; i < fields.length; i++) { + values.get(i).addValue(types.get(i), fields[i]); + } + return this; } - public RowSet addRow(Row row) { - rows.add(row); - return this; + public List getValues() { + return values; } - public RowSet addRow(TableSchema schema, Object[] fields) { - return addRow(new Row(schema, fields)); + public int numColumns() { + return values.size(); + } + + public int numRows() { + return values.isEmpty() ? 0 : values.get(0).size(); + } + + public static Object evaluate(ColumnDescriptor desc, Object value) { + return evaluate(desc.getType(), value); + } + + public static Object evaluate(Type type, Object value) { + switch (type) { + case BINARY_TYPE: + return value == null ? null : ((ByteBuffer) value).array(); + case TIMESTAMP_TYPE: + return value == null ? null : Timestamp.valueOf((String) value); + case DECIMAL_TYPE: + return value == null ? null : new BigDecimal((String)value); + case DATE_TYPE: + return value == null ? null : Date.valueOf((String) value); + case NULL_TYPE: + return null; + default: + return value; + } } public RowSet extractSubset(int maxRows) { - int numRows = rows.size(); - maxRows = (maxRows <= numRows) ? maxRows : numRows; - RowSet result = new RowSet(rows.subList(0, maxRows), startOffset); - rows = new ArrayList(rows.subList(maxRows, numRows)); - startOffset += result.getSize(); + int numRows = Math.min(numRows(), maxRows); + + List subset = new ArrayList(); + for (int i = 0; i < values.size(); i++) { + subset.add(values.get(i).extractSubset(0, numRows)); + } + RowSet result = new RowSet(types, subset, startOffset); + startOffset += numRows; return result; } @@ -79,46 +127,47 @@ public RowSet setStartOffset(long startOffset) { return this; } - public boolean getHasMoreResults() { - return hasMoreResults; - } - - public RowSet setHasMoreResults(boolean hasMoreResults) { - this.hasMoreResults = hasMoreResults; - return this; - } - - public int getSize() { - return rows.size(); - } - public TRowSet toTRowSet() { TRowSet tRowSet = new TRowSet(); tRowSet.setStartRowOffset(startOffset); - List tRows = new ArrayList(); - for (Row row : rows) { - tRows.add(row.toTRow()); + for (int i = 0; i < values.size(); i++) { + tRowSet.addToColVals(values.get(i).toTColumnValue()); } - tRowSet.setRows(tRows); - - /* - //List booleanColumn = new ArrayList(); - //List byteColumn = new ArrayList(); - //List shortColumn = new ArrayList(); - List integerColumn = new ArrayList(); - - integerColumn.add(1); - //integerColumn.add(null); - integerColumn.add(3); - //integerColumn.add(null); - + return tRowSet; + } - TColumnUnion column = TColumnUnion.i32Column(integerColumn); - List columns = new ArrayList(); - columns.add(column); - tRowSet.setColumns(columns); - */ + @Override + public Iterator iterator() { + return new Iterator() { + + private int index; + private final Object[] convey = new Object[numColumns()]; + + @Override + public boolean hasNext() { + return index < numRows(); + } + + @Override + public Object[] next() { + for (int i = 0; i < values.size(); i++) { + convey[i] = values.get(i).get(index); + } + index++; + return convey; + } + + @Override + public void remove() { + throw new UnsupportedOperationException("remove"); + } + }; + } - return tRowSet; + public Object[] fill(int index, Object[] convey) { + for (int i = 0; i < values.size(); i++) { + convey[i] = values.get(i).get(index); + } + return convey; } } diff --git service/src/java/org/apache/hive/service/cli/TableSchema.java service/src/java/org/apache/hive/service/cli/TableSchema.java index 155f529..49e3c1e 100644 --- service/src/java/org/apache/hive/service/cli/TableSchema.java +++ service/src/java/org/apache/hive/service/cli/TableSchema.java @@ -53,6 +53,10 @@ public TableSchema(List fieldSchemas) { } } + public List getColumnDescs() { + return columns; + } + public TableSchema(Schema schema) { this(schema.getFieldSchemas()); } diff --git service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java index 581e69c..0b1d7e3 100644 --- service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java @@ -34,7 +34,7 @@ private static final TableSchema RESULT_SET_SCHEMA = new TableSchema() .addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable."); - private final RowSet rowSet = new RowSet(); + private final RowSet rowSet = new RowSet(RESULT_SET_SCHEMA); protected GetCatalogsOperation(HiveSession parentSession) { super(parentSession, OperationType.GET_CATALOGS); diff --git service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java index af87a90..64d7f67 100644 --- service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java @@ -101,7 +101,7 @@ private final String tableName; private final String columnName; - private final RowSet rowSet = new RowSet(); + private final RowSet rowSet = new RowSet(RESULT_SET_SCHEMA); protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName, String tableName, String columnName) { @@ -164,7 +164,7 @@ public void run() throws HiveSQLException { null, // SOURCE_DATA_TYPE "NO", // IS_AUTO_INCREMENT }; - rowSet.addRow(RESULT_SET_SCHEMA, rowData); + rowSet.addRow(rowData); } } } diff --git service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java index 0fe01c0..1898542 100644 --- service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java @@ -56,7 +56,7 @@ private final String schemaName; private final String functionName; - private final RowSet rowSet = new RowSet(); + private final RowSet rowSet = new RowSet(RESULT_SET_SCHEMA); public GetFunctionsOperation(HiveSession parentSession, String catalogName, String schemaName, String functionName) { @@ -89,7 +89,7 @@ public void run() throws HiveSQLException { : DatabaseMetaData.functionNoTable), // FUNCTION_TYPE functionInfo.getClass().getCanonicalName() }; - rowSet.addRow(RESULT_SET_SCHEMA, rowData); + rowSet.addRow(rowData); } } setState(OperationState.FINISHED); diff --git service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java index bafe40c..94337e7 100644 --- service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java @@ -54,12 +54,12 @@ protected GetSchemasOperation(HiveSession parentSession, @Override public void run() throws HiveSQLException { setState(OperationState.RUNNING); - rowSet = new RowSet(); + rowSet = new RowSet(RESULT_SET_SCHEMA); try { IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient(); String schemaPattern = convertSchemaPattern(schemaName); for (String dbName : metastoreClient.getDatabases(schemaPattern)) { - rowSet.addRow(RESULT_SET_SCHEMA, new Object[] {dbName, DEFAULT_HIVE_CATALOG}); + rowSet.addRow(new Object[] {dbName, DEFAULT_HIVE_CATALOG}); } setState(OperationState.FINISHED); } catch (Exception e) { diff --git service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java index 2be018e..528262e 100644 --- service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java @@ -55,10 +55,9 @@ protected GetTableTypesOperation(HiveSession parentSession) { public void run() throws HiveSQLException { setState(OperationState.RUNNING); try { - rowSet = new RowSet(); + rowSet = new RowSet(RESULT_SET_SCHEMA); for (TableType type : TableType.values()) { - rowSet.addRow(RESULT_SET_SCHEMA, - new String[] {tableTypeMapping.mapToClientType(type.toString())}); + rowSet.addRow(new String[] {tableTypeMapping.mapToClientType(type.toString())}); } setState(OperationState.FINISHED); } catch (Exception e) { diff --git service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java index 7e8a06b..c6f8c64 100644 --- service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java @@ -42,7 +42,7 @@ private final String schemaName; private final String tableName; private final List tableTypes = new ArrayList(); - private final RowSet rowSet = new RowSet(); + private final RowSet rowSet = new RowSet(RESULT_SET_SCHEMA); private final TableTypeMapping tableTypeMapping; @@ -91,7 +91,7 @@ public void run() throws HiveSQLException { }; if (tableTypes.isEmpty() || tableTypes.contains( tableTypeMapping.mapToClientType(table.getTableType()))) { - rowSet.addRow(RESULT_SET_SCHEMA, rowData); + rowSet.addRow(rowData); } } } diff --git service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java index 2daa9cd..58d85e8 100644 --- service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java @@ -71,7 +71,7 @@ .addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE, "Usually 2 or 10"); - private final RowSet rowSet = new RowSet(); + private final RowSet rowSet = new RowSet(RESULT_SET_SCHEMA); protected GetTypeInfoOperation(HiveSession parentSession) { super(parentSession, OperationType.GET_TYPE_INFO); @@ -105,7 +105,7 @@ public void run() throws HiveSQLException { null, // SQL_DATETIME_SUB, unused type.getNumPrecRadix() //NUM_PREC_RADIX }; - rowSet.addRow(RESULT_SET_SCHEMA, rowData); + rowSet.addRow(rowData); } setState(OperationState.FINISHED); } catch (Exception e) { diff --git service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java index a1ac55b..24f3c5c 100644 --- service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java @@ -153,10 +153,10 @@ public TableSchema getResultSetSchema() throws HiveSQLException { @Override public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { List rows = readResults((int) maxRows); - RowSet rowSet = new RowSet(); + RowSet rowSet = new RowSet(resultSchema); for (String row : rows) { - rowSet.addRow(resultSchema, new String[] {row}); + rowSet.addRow(new String[] {row}); } return rowSet; } 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 301187d..02678ae 100644 --- service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java +++ service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java @@ -237,7 +237,7 @@ public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws H getSerDe(); StructObjectInspector soi = (StructObjectInspector) serde.getObjectInspector(); List fieldRefs = soi.getAllStructFieldRefs(); - RowSet rowSet = new RowSet(); + RowSet rowSet = new RowSet(resultSchema); Object[] deserializedFields = new Object[fieldRefs.size()]; Object rowObj; @@ -250,7 +250,7 @@ public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws H fieldOI = fieldRef.getFieldObjectInspector(); deserializedFields[i] = convertLazyToJava(soi.getStructFieldData(rowObj, fieldRef), fieldOI); } - rowSet.addRow(resultSchema, deserializedFields); + rowSet.addRow(deserializedFields); } return rowSet; } catch (IOException e) { @@ -269,23 +269,17 @@ 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); } - private SerDe getSerDe() throws SQLException { if (serde != null) { return serde;