You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by th...@apache.org on 2013/12/18 02:48:25 UTC
svn commit: r1551801 [1/2] - in /hive/trunk:
jdbc/src/java/org/apache/hive/jdbc/ service/if/
service/src/gen/thrift/gen-cpp/
service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/
service/src/gen/thrift/gen-javabean/org/apache/hive/service...
Author: thejas
Date: Wed Dec 18 01:48:24 2013
New Revision: 1551801
URL: http://svn.apache.org/r1551801
Log:
HIVE-5230 : Better error reporting by async threads in HiveServer2 (Vaibhav Gumashta via Thejas Nair)
Added:
hive/trunk/service/src/java/org/apache/hive/service/cli/OperationStatus.java
Modified:
hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
hive/trunk/service/if/TCLIService.thrift
hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.cpp
hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.h
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TProtocolVersion.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java
hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java
hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py
hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java
hive/trunk/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java
hive/trunk/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java
hive/trunk/service/src/java/org/apache/hive/service/cli/ICLIService.java
hive/trunk/service/src/java/org/apache/hive/service/cli/OperationState.java
hive/trunk/service/src/java/org/apache/hive/service/cli/operation/Operation.java
hive/trunk/service/src/java/org/apache/hive/service/cli/operation/OperationManager.java
hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
hive/trunk/service/src/java/org/apache/hive/service/cli/session/SessionManager.java
hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java
hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java
hive/trunk/service/src/test/org/apache/hive/service/cli/CLIServiceTest.java
hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java
Modified: hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java Wed Dec 18 01:48:24 2013
@@ -137,6 +137,7 @@ public class HiveConnection implements j
supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V2);
supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V3);
supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V4);
+ supportedProtocols.add(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5);
// open client session
openSession();
@@ -145,9 +146,7 @@ public class HiveConnection implements j
}
private void openTransport() throws SQLException {
- transport = isHttpTransportMode() ?
- createHttpTransport() :
- createBinaryTransport();
+ transport = isHttpTransportMode() ? createHttpTransport() : createBinaryTransport();
TProtocol protocol = new TBinaryProtocol(transport);
client = new TCLIService.Client(protocol);
try {
Modified: hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
URL: http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java (original)
+++ hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java Wed Dec 18 01:48:24 2013
@@ -238,6 +238,7 @@ public class HiveStatement implements ja
case UKNOWN_STATE:
throw new SQLException("Unknown query", "HY000");
case INITIALIZED_STATE:
+ case PENDING_STATE:
case RUNNING_STATE:
break;
}
Modified: hive/trunk/service/if/TCLIService.thrift
URL: http://svn.apache.org/viewvc/hive/trunk/service/if/TCLIService.thrift?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/if/TCLIService.thrift (original)
+++ hive/trunk/service/if/TCLIService.thrift Wed Dec 18 01:48:24 2013
@@ -48,6 +48,9 @@ enum TProtocolVersion {
// V4 add decimal precision/scale, char type
HIVE_CLI_SERVICE_PROTOCOL_V4
+
+ // V5 adds error details when GetOperationStatus returns in error state
+ HIVE_CLI_SERVICE_PROTOCOL_V5
}
enum TTypeId {
@@ -389,12 +392,11 @@ enum TOperationState {
// The operation is in an unrecognized state
UKNOWN_STATE,
-
+
// The operation is in an pending state
PENDING_STATE,
}
-
// A string identifier. This is interpreted literally.
typedef string TIdentifier
@@ -485,11 +487,11 @@ struct TOperationHandle {
// OpenSession()
//
// Open a session (connection) on the server against
-// which operations may be executed.
+// which operations may be executed.
struct TOpenSessionReq {
// The version of the HiveServer2 protocol that the client is using.
- 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V3
-
+ 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5
+
// Username and password for authentication.
// Depending on the authentication scheme being used,
// this information may instead be provided by a lower
@@ -507,7 +509,7 @@ struct TOpenSessionResp {
1: required TStatus status
// The protocol version that the server is using.
- 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V4
+ 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5
// Session Handle
3: optional TSessionHandle sessionHandle
@@ -904,6 +906,16 @@ struct TGetOperationStatusReq {
struct TGetOperationStatusResp {
1: required TStatus status
2: optional TOperationState operationState
+
+ // If operationState is ERROR_STATE, then the following fields may be set
+ // sqlState as defined in the ISO/IEF CLI specification
+ 3: optional string sqlState
+
+ // Internal error code
+ 4: optional i32 errorCode
+
+ // Error message
+ 5: optional string errorMessage
}
Modified: hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.cpp
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.cpp?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.cpp (original)
+++ hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.cpp Wed Dec 18 01:48:24 2013
@@ -14,15 +14,17 @@ int _kTProtocolVersionValues[] = {
TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V1,
TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V2,
TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V3,
- TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V4
+ TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V4,
+ TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V5
};
const char* _kTProtocolVersionNames[] = {
"HIVE_CLI_SERVICE_PROTOCOL_V1",
"HIVE_CLI_SERVICE_PROTOCOL_V2",
"HIVE_CLI_SERVICE_PROTOCOL_V3",
- "HIVE_CLI_SERVICE_PROTOCOL_V4"
+ "HIVE_CLI_SERVICE_PROTOCOL_V4",
+ "HIVE_CLI_SERVICE_PROTOCOL_V5"
};
-const std::map<int, const char*> _TProtocolVersion_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(4, _kTProtocolVersionValues, _kTProtocolVersionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+const std::map<int, const char*> _TProtocolVersion_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kTProtocolVersionValues, _kTProtocolVersionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
int _kTTypeIdValues[] = {
TTypeId::BOOLEAN_TYPE,
@@ -4936,8 +4938,8 @@ void swap(TGetOperationStatusReq &a, TGe
swap(a.operationHandle, b.operationHandle);
}
-const char* TGetOperationStatusResp::ascii_fingerprint = "4F27EC6715D9B6D702A4842459E6587B";
-const uint8_t TGetOperationStatusResp::binary_fingerprint[16] = {0x4F,0x27,0xEC,0x67,0x15,0xD9,0xB6,0xD7,0x02,0xA4,0x84,0x24,0x59,0xE6,0x58,0x7B};
+const char* TGetOperationStatusResp::ascii_fingerprint = "BD124DB87A5A2E7D11945BD1B17F013D";
+const uint8_t TGetOperationStatusResp::binary_fingerprint[16] = {0xBD,0x12,0x4D,0xB8,0x7A,0x5A,0x2E,0x7D,0x11,0x94,0x5B,0xD1,0xB1,0x7F,0x01,0x3D};
uint32_t TGetOperationStatusResp::read(::apache::thrift::protocol::TProtocol* iprot) {
@@ -4978,6 +4980,30 @@ uint32_t TGetOperationStatusResp::read(:
xfer += iprot->skip(ftype);
}
break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->sqlState);
+ this->__isset.sqlState = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ xfer += iprot->readI32(this->errorCode);
+ this->__isset.errorCode = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->errorMessage);
+ this->__isset.errorMessage = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
default:
xfer += iprot->skip(ftype);
break;
@@ -5005,6 +5031,21 @@ uint32_t TGetOperationStatusResp::write(
xfer += oprot->writeI32((int32_t)this->operationState);
xfer += oprot->writeFieldEnd();
}
+ if (this->__isset.sqlState) {
+ xfer += oprot->writeFieldBegin("sqlState", ::apache::thrift::protocol::T_STRING, 3);
+ xfer += oprot->writeString(this->sqlState);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.errorCode) {
+ xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32(this->errorCode);
+ xfer += oprot->writeFieldEnd();
+ }
+ if (this->__isset.errorMessage) {
+ xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 5);
+ xfer += oprot->writeString(this->errorMessage);
+ xfer += oprot->writeFieldEnd();
+ }
xfer += oprot->writeFieldStop();
xfer += oprot->writeStructEnd();
return xfer;
@@ -5014,6 +5055,9 @@ void swap(TGetOperationStatusResp &a, TG
using ::std::swap;
swap(a.status, b.status);
swap(a.operationState, b.operationState);
+ swap(a.sqlState, b.sqlState);
+ swap(a.errorCode, b.errorCode);
+ swap(a.errorMessage, b.errorMessage);
swap(a.__isset, b.__isset);
}
Modified: hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.h
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.h?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.h (original)
+++ hive/trunk/service/src/gen/thrift/gen-cpp/TCLIService_types.h Wed Dec 18 01:48:24 2013
@@ -21,7 +21,8 @@ struct TProtocolVersion {
HIVE_CLI_SERVICE_PROTOCOL_V1 = 0,
HIVE_CLI_SERVICE_PROTOCOL_V2 = 1,
HIVE_CLI_SERVICE_PROTOCOL_V3 = 2,
- HIVE_CLI_SERVICE_PROTOCOL_V4 = 3
+ HIVE_CLI_SERVICE_PROTOCOL_V4 = 3,
+ HIVE_CLI_SERVICE_PROTOCOL_V5 = 4
};
};
@@ -1583,8 +1584,8 @@ class TOpenSessionReq {
static const char* ascii_fingerprint; // = "C8FD0F306A16C16BDA7B57F58BFAE5B2";
static const uint8_t binary_fingerprint[16]; // = {0xC8,0xFD,0x0F,0x30,0x6A,0x16,0xC1,0x6B,0xDA,0x7B,0x57,0xF5,0x8B,0xFA,0xE5,0xB2};
- TOpenSessionReq() : client_protocol((TProtocolVersion::type)2), username(), password() {
- client_protocol = (TProtocolVersion::type)2;
+ TOpenSessionReq() : client_protocol((TProtocolVersion::type)4), username(), password() {
+ client_protocol = (TProtocolVersion::type)4;
}
@@ -1659,8 +1660,8 @@ class TOpenSessionResp {
static const char* ascii_fingerprint; // = "CFE7D7F4E9EC671F2518ED74FEE9F163";
static const uint8_t binary_fingerprint[16]; // = {0xCF,0xE7,0xD7,0xF4,0xE9,0xEC,0x67,0x1F,0x25,0x18,0xED,0x74,0xFE,0xE9,0xF1,0x63};
- TOpenSessionResp() : serverProtocolVersion((TProtocolVersion::type)3) {
- serverProtocolVersion = (TProtocolVersion::type)3;
+ TOpenSessionResp() : serverProtocolVersion((TProtocolVersion::type)4) {
+ serverProtocolVersion = (TProtocolVersion::type)4;
}
@@ -2916,23 +2917,29 @@ class TGetOperationStatusReq {
void swap(TGetOperationStatusReq &a, TGetOperationStatusReq &b);
typedef struct _TGetOperationStatusResp__isset {
- _TGetOperationStatusResp__isset() : operationState(false) {}
+ _TGetOperationStatusResp__isset() : operationState(false), sqlState(false), errorCode(false), errorMessage(false) {}
bool operationState;
+ bool sqlState;
+ bool errorCode;
+ bool errorMessage;
} _TGetOperationStatusResp__isset;
class TGetOperationStatusResp {
public:
- static const char* ascii_fingerprint; // = "4F27EC6715D9B6D702A4842459E6587B";
- static const uint8_t binary_fingerprint[16]; // = {0x4F,0x27,0xEC,0x67,0x15,0xD9,0xB6,0xD7,0x02,0xA4,0x84,0x24,0x59,0xE6,0x58,0x7B};
+ static const char* ascii_fingerprint; // = "BD124DB87A5A2E7D11945BD1B17F013D";
+ static const uint8_t binary_fingerprint[16]; // = {0xBD,0x12,0x4D,0xB8,0x7A,0x5A,0x2E,0x7D,0x11,0x94,0x5B,0xD1,0xB1,0x7F,0x01,0x3D};
- TGetOperationStatusResp() : operationState((TOperationState::type)0) {
+ TGetOperationStatusResp() : operationState((TOperationState::type)0), sqlState(), errorCode(0), errorMessage() {
}
virtual ~TGetOperationStatusResp() throw() {}
TStatus status;
TOperationState::type operationState;
+ std::string sqlState;
+ int32_t errorCode;
+ std::string errorMessage;
_TGetOperationStatusResp__isset __isset;
@@ -2945,6 +2952,21 @@ class TGetOperationStatusResp {
__isset.operationState = true;
}
+ void __set_sqlState(const std::string& val) {
+ sqlState = val;
+ __isset.sqlState = true;
+ }
+
+ void __set_errorCode(const int32_t val) {
+ errorCode = val;
+ __isset.errorCode = true;
+ }
+
+ void __set_errorMessage(const std::string& val) {
+ errorMessage = val;
+ __isset.errorMessage = true;
+ }
+
bool operator == (const TGetOperationStatusResp & rhs) const
{
if (!(status == rhs.status))
@@ -2953,6 +2975,18 @@ class TGetOperationStatusResp {
return false;
else if (__isset.operationState && !(operationState == rhs.operationState))
return false;
+ if (__isset.sqlState != rhs.__isset.sqlState)
+ return false;
+ else if (__isset.sqlState && !(sqlState == rhs.sqlState))
+ return false;
+ if (__isset.errorCode != rhs.__isset.errorCode)
+ return false;
+ else if (__isset.errorCode && !(errorCode == rhs.errorCode))
+ return false;
+ if (__isset.errorMessage != rhs.__isset.errorMessage)
+ return false;
+ else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage))
+ return false;
return true;
}
bool operator != (const TGetOperationStatusResp &rhs) const {
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java Wed Dec 18 01:48:24 2013
@@ -3023,7 +3023,7 @@ public class ThriftHive {
struct.success = new ArrayList<String>(_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 class ThriftHive {
struct.success = new ArrayList<String>(_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 class ThriftHive {
struct.success = new ArrayList<String>(_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 class ThriftHive {
struct.success = new ArrayList<String>(_list13.size);
for (int _i14 = 0; _i14 < _list13.size; ++_i14)
{
- String _elem15; // optional
+ String _elem15; // required
_elem15 = iprot.readString();
struct.success.add(_elem15);
}
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TColumn.java Wed Dec 18 01:48:24 2013
@@ -259,7 +259,7 @@ public class TColumn extends org.apache.
boolColumn = new ArrayList<TBoolValue>(_list46.size);
for (int _i47 = 0; _i47 < _list46.size; ++_i47)
{
- TBoolValue _elem48; // optional
+ TBoolValue _elem48; // required
_elem48 = new TBoolValue();
_elem48.read(iprot);
boolColumn.add(_elem48);
@@ -279,7 +279,7 @@ public class TColumn extends org.apache.
byteColumn = new ArrayList<TByteValue>(_list49.size);
for (int _i50 = 0; _i50 < _list49.size; ++_i50)
{
- TByteValue _elem51; // optional
+ TByteValue _elem51; // required
_elem51 = new TByteValue();
_elem51.read(iprot);
byteColumn.add(_elem51);
@@ -299,7 +299,7 @@ public class TColumn extends org.apache.
i16Column = new ArrayList<TI16Value>(_list52.size);
for (int _i53 = 0; _i53 < _list52.size; ++_i53)
{
- TI16Value _elem54; // optional
+ TI16Value _elem54; // required
_elem54 = new TI16Value();
_elem54.read(iprot);
i16Column.add(_elem54);
@@ -319,7 +319,7 @@ public class TColumn extends org.apache.
i32Column = new ArrayList<TI32Value>(_list55.size);
for (int _i56 = 0; _i56 < _list55.size; ++_i56)
{
- TI32Value _elem57; // optional
+ TI32Value _elem57; // required
_elem57 = new TI32Value();
_elem57.read(iprot);
i32Column.add(_elem57);
@@ -339,7 +339,7 @@ public class TColumn extends org.apache.
i64Column = new ArrayList<TI64Value>(_list58.size);
for (int _i59 = 0; _i59 < _list58.size; ++_i59)
{
- TI64Value _elem60; // optional
+ TI64Value _elem60; // required
_elem60 = new TI64Value();
_elem60.read(iprot);
i64Column.add(_elem60);
@@ -359,7 +359,7 @@ public class TColumn extends org.apache.
doubleColumn = new ArrayList<TDoubleValue>(_list61.size);
for (int _i62 = 0; _i62 < _list61.size; ++_i62)
{
- TDoubleValue _elem63; // optional
+ TDoubleValue _elem63; // required
_elem63 = new TDoubleValue();
_elem63.read(iprot);
doubleColumn.add(_elem63);
@@ -379,7 +379,7 @@ public class TColumn extends org.apache.
stringColumn = new ArrayList<TStringValue>(_list64.size);
for (int _i65 = 0; _i65 < _list64.size; ++_i65)
{
- TStringValue _elem66; // optional
+ TStringValue _elem66; // required
_elem66 = new TStringValue();
_elem66.read(iprot);
stringColumn.add(_elem66);
@@ -496,7 +496,7 @@ public class TColumn extends org.apache.
boolColumn = new ArrayList<TBoolValue>(_list74.size);
for (int _i75 = 0; _i75 < _list74.size; ++_i75)
{
- TBoolValue _elem76; // optional
+ TBoolValue _elem76; // required
_elem76 = new TBoolValue();
_elem76.read(iprot);
boolColumn.add(_elem76);
@@ -511,7 +511,7 @@ public class TColumn extends org.apache.
byteColumn = new ArrayList<TByteValue>(_list77.size);
for (int _i78 = 0; _i78 < _list77.size; ++_i78)
{
- TByteValue _elem79; // optional
+ TByteValue _elem79; // required
_elem79 = new TByteValue();
_elem79.read(iprot);
byteColumn.add(_elem79);
@@ -526,7 +526,7 @@ public class TColumn extends org.apache.
i16Column = new ArrayList<TI16Value>(_list80.size);
for (int _i81 = 0; _i81 < _list80.size; ++_i81)
{
- TI16Value _elem82; // optional
+ TI16Value _elem82; // required
_elem82 = new TI16Value();
_elem82.read(iprot);
i16Column.add(_elem82);
@@ -541,7 +541,7 @@ public class TColumn extends org.apache.
i32Column = new ArrayList<TI32Value>(_list83.size);
for (int _i84 = 0; _i84 < _list83.size; ++_i84)
{
- TI32Value _elem85; // optional
+ TI32Value _elem85; // required
_elem85 = new TI32Value();
_elem85.read(iprot);
i32Column.add(_elem85);
@@ -556,7 +556,7 @@ public class TColumn extends org.apache.
i64Column = new ArrayList<TI64Value>(_list86.size);
for (int _i87 = 0; _i87 < _list86.size; ++_i87)
{
- TI64Value _elem88; // optional
+ TI64Value _elem88; // required
_elem88 = new TI64Value();
_elem88.read(iprot);
i64Column.add(_elem88);
@@ -571,7 +571,7 @@ public class TColumn extends org.apache.
doubleColumn = new ArrayList<TDoubleValue>(_list89.size);
for (int _i90 = 0; _i90 < _list89.size; ++_i90)
{
- TDoubleValue _elem91; // optional
+ TDoubleValue _elem91; // required
_elem91 = new TDoubleValue();
_elem91.read(iprot);
doubleColumn.add(_elem91);
@@ -586,7 +586,7 @@ public class TColumn extends org.apache.
stringColumn = new ArrayList<TStringValue>(_list92.size);
for (int _i93 = 0; _i93 < _list92.size; ++_i93)
{
- TStringValue _elem94; // optional
+ TStringValue _elem94; // required
_elem94 = new TStringValue();
_elem94.read(iprot);
stringColumn.add(_elem94);
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java Wed Dec 18 01:48:24 2013
@@ -36,6 +36,9 @@ public class TGetOperationStatusResp imp
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField OPERATION_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationState", org.apache.thrift.protocol.TType.I32, (short)2);
+ private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3);
+ private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4);
+ private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -45,6 +48,9 @@ public class TGetOperationStatusResp imp
private TStatus status; // required
private TOperationState operationState; // optional
+ private String sqlState; // optional
+ private int errorCode; // optional
+ private String errorMessage; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -53,7 +59,10 @@ public class TGetOperationStatusResp imp
*
* @see TOperationState
*/
- OPERATION_STATE((short)2, "operationState");
+ OPERATION_STATE((short)2, "operationState"),
+ SQL_STATE((short)3, "sqlState"),
+ ERROR_CODE((short)4, "errorCode"),
+ ERROR_MESSAGE((short)5, "errorMessage");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -72,6 +81,12 @@ public class TGetOperationStatusResp imp
return STATUS;
case 2: // OPERATION_STATE
return OPERATION_STATE;
+ case 3: // SQL_STATE
+ return SQL_STATE;
+ case 4: // ERROR_CODE
+ return ERROR_CODE;
+ case 5: // ERROR_MESSAGE
+ return ERROR_MESSAGE;
default:
return null;
}
@@ -112,7 +127,9 @@ public class TGetOperationStatusResp imp
}
// isset id assignments
- private _Fields optionals[] = {_Fields.OPERATION_STATE};
+ private static final int __ERRORCODE_ISSET_ID = 0;
+ private byte __isset_bitfield = 0;
+ private _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE};
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);
@@ -120,6 +137,12 @@ public class TGetOperationStatusResp imp
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class)));
tmpMap.put(_Fields.OPERATION_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationState.class)));
+ tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap);
}
@@ -138,12 +161,20 @@ public class TGetOperationStatusResp imp
* Performs a deep copy on <i>other</i>.
*/
public TGetOperationStatusResp(TGetOperationStatusResp other) {
+ __isset_bitfield = other.__isset_bitfield;
if (other.isSetStatus()) {
this.status = new TStatus(other.status);
}
if (other.isSetOperationState()) {
this.operationState = other.operationState;
}
+ if (other.isSetSqlState()) {
+ this.sqlState = other.sqlState;
+ }
+ this.errorCode = other.errorCode;
+ if (other.isSetErrorMessage()) {
+ this.errorMessage = other.errorMessage;
+ }
}
public TGetOperationStatusResp deepCopy() {
@@ -154,6 +185,10 @@ public class TGetOperationStatusResp imp
public void clear() {
this.status = null;
this.operationState = null;
+ this.sqlState = null;
+ setErrorCodeIsSet(false);
+ this.errorCode = 0;
+ this.errorMessage = null;
}
public TStatus getStatus() {
@@ -210,6 +245,74 @@ public class TGetOperationStatusResp imp
}
}
+ public String getSqlState() {
+ return this.sqlState;
+ }
+
+ public void setSqlState(String sqlState) {
+ this.sqlState = sqlState;
+ }
+
+ public void unsetSqlState() {
+ this.sqlState = null;
+ }
+
+ /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */
+ public boolean isSetSqlState() {
+ return this.sqlState != null;
+ }
+
+ public void setSqlStateIsSet(boolean value) {
+ if (!value) {
+ this.sqlState = null;
+ }
+ }
+
+ public int getErrorCode() {
+ return this.errorCode;
+ }
+
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ setErrorCodeIsSet(true);
+ }
+
+ public void unsetErrorCode() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID);
+ }
+
+ /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */
+ public boolean isSetErrorCode() {
+ return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID);
+ }
+
+ public void setErrorCodeIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value);
+ }
+
+ public String getErrorMessage() {
+ return this.errorMessage;
+ }
+
+ public void setErrorMessage(String errorMessage) {
+ this.errorMessage = errorMessage;
+ }
+
+ public void unsetErrorMessage() {
+ this.errorMessage = null;
+ }
+
+ /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */
+ public boolean isSetErrorMessage() {
+ return this.errorMessage != null;
+ }
+
+ public void setErrorMessageIsSet(boolean value) {
+ if (!value) {
+ this.errorMessage = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case STATUS:
@@ -228,6 +331,30 @@ public class TGetOperationStatusResp imp
}
break;
+ case SQL_STATE:
+ if (value == null) {
+ unsetSqlState();
+ } else {
+ setSqlState((String)value);
+ }
+ break;
+
+ case ERROR_CODE:
+ if (value == null) {
+ unsetErrorCode();
+ } else {
+ setErrorCode((Integer)value);
+ }
+ break;
+
+ case ERROR_MESSAGE:
+ if (value == null) {
+ unsetErrorMessage();
+ } else {
+ setErrorMessage((String)value);
+ }
+ break;
+
}
}
@@ -239,6 +366,15 @@ public class TGetOperationStatusResp imp
case OPERATION_STATE:
return getOperationState();
+ case SQL_STATE:
+ return getSqlState();
+
+ case ERROR_CODE:
+ return Integer.valueOf(getErrorCode());
+
+ case ERROR_MESSAGE:
+ return getErrorMessage();
+
}
throw new IllegalStateException();
}
@@ -254,6 +390,12 @@ public class TGetOperationStatusResp imp
return isSetStatus();
case OPERATION_STATE:
return isSetOperationState();
+ case SQL_STATE:
+ return isSetSqlState();
+ case ERROR_CODE:
+ return isSetErrorCode();
+ case ERROR_MESSAGE:
+ return isSetErrorMessage();
}
throw new IllegalStateException();
}
@@ -289,6 +431,33 @@ public class TGetOperationStatusResp imp
return false;
}
+ boolean this_present_sqlState = true && this.isSetSqlState();
+ boolean that_present_sqlState = true && that.isSetSqlState();
+ if (this_present_sqlState || that_present_sqlState) {
+ if (!(this_present_sqlState && that_present_sqlState))
+ return false;
+ if (!this.sqlState.equals(that.sqlState))
+ return false;
+ }
+
+ boolean this_present_errorCode = true && this.isSetErrorCode();
+ boolean that_present_errorCode = true && that.isSetErrorCode();
+ if (this_present_errorCode || that_present_errorCode) {
+ if (!(this_present_errorCode && that_present_errorCode))
+ return false;
+ if (this.errorCode != that.errorCode)
+ return false;
+ }
+
+ boolean this_present_errorMessage = true && this.isSetErrorMessage();
+ boolean that_present_errorMessage = true && that.isSetErrorMessage();
+ if (this_present_errorMessage || that_present_errorMessage) {
+ if (!(this_present_errorMessage && that_present_errorMessage))
+ return false;
+ if (!this.errorMessage.equals(that.errorMessage))
+ return false;
+ }
+
return true;
}
@@ -306,6 +475,21 @@ public class TGetOperationStatusResp imp
if (present_operationState)
builder.append(operationState.getValue());
+ boolean present_sqlState = true && (isSetSqlState());
+ builder.append(present_sqlState);
+ if (present_sqlState)
+ builder.append(sqlState);
+
+ boolean present_errorCode = true && (isSetErrorCode());
+ builder.append(present_errorCode);
+ if (present_errorCode)
+ builder.append(errorCode);
+
+ boolean present_errorMessage = true && (isSetErrorMessage());
+ builder.append(present_errorMessage);
+ if (present_errorMessage)
+ builder.append(errorMessage);
+
return builder.toHashCode();
}
@@ -337,6 +521,36 @@ public class TGetOperationStatusResp imp
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(typedOther.isSetSqlState());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSqlState()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, typedOther.sqlState);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(typedOther.isSetErrorCode());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetErrorCode()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, typedOther.errorCode);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(typedOther.isSetErrorMessage());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetErrorMessage()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, typedOther.errorMessage);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -374,6 +588,32 @@ public class TGetOperationStatusResp imp
}
first = false;
}
+ if (isSetSqlState()) {
+ if (!first) sb.append(", ");
+ sb.append("sqlState:");
+ if (this.sqlState == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.sqlState);
+ }
+ first = false;
+ }
+ if (isSetErrorCode()) {
+ if (!first) sb.append(", ");
+ sb.append("errorCode:");
+ sb.append(this.errorCode);
+ first = false;
+ }
+ if (isSetErrorMessage()) {
+ if (!first) sb.append(", ");
+ sb.append("errorMessage:");
+ if (this.errorMessage == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.errorMessage);
+ }
+ first = false;
+ }
sb.append(")");
return sb.toString();
}
@@ -400,6 +640,8 @@ public class TGetOperationStatusResp imp
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);
@@ -441,6 +683,30 @@ public class TGetOperationStatusResp imp
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 3: // SQL_STATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.sqlState = iprot.readString();
+ struct.setSqlStateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // ERROR_CODE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.errorCode = iprot.readI32();
+ struct.setErrorCodeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // ERROR_MESSAGE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.errorMessage = iprot.readString();
+ struct.setErrorMessageIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -466,6 +732,25 @@ public class TGetOperationStatusResp imp
oprot.writeFieldEnd();
}
}
+ if (struct.sqlState != null) {
+ if (struct.isSetSqlState()) {
+ oprot.writeFieldBegin(SQL_STATE_FIELD_DESC);
+ oprot.writeString(struct.sqlState);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetErrorCode()) {
+ oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC);
+ oprot.writeI32(struct.errorCode);
+ oprot.writeFieldEnd();
+ }
+ if (struct.errorMessage != null) {
+ if (struct.isSetErrorMessage()) {
+ oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC);
+ oprot.writeString(struct.errorMessage);
+ oprot.writeFieldEnd();
+ }
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -488,10 +773,28 @@ public class TGetOperationStatusResp imp
if (struct.isSetOperationState()) {
optionals.set(0);
}
- oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSqlState()) {
+ optionals.set(1);
+ }
+ if (struct.isSetErrorCode()) {
+ optionals.set(2);
+ }
+ if (struct.isSetErrorMessage()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
if (struct.isSetOperationState()) {
oprot.writeI32(struct.operationState.getValue());
}
+ if (struct.isSetSqlState()) {
+ oprot.writeString(struct.sqlState);
+ }
+ if (struct.isSetErrorCode()) {
+ oprot.writeI32(struct.errorCode);
+ }
+ if (struct.isSetErrorMessage()) {
+ oprot.writeString(struct.errorMessage);
+ }
}
@Override
@@ -500,11 +803,23 @@ public class TGetOperationStatusResp imp
struct.status = new TStatus();
struct.status.read(iprot);
struct.setStatusIsSet(true);
- BitSet incoming = iprot.readBitSet(1);
+ BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.operationState = TOperationState.findByValue(iprot.readI32());
struct.setOperationStateIsSet(true);
}
+ if (incoming.get(1)) {
+ struct.sqlState = iprot.readString();
+ struct.setSqlStateIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.errorCode = iprot.readI32();
+ struct.setErrorCodeIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.errorMessage = iprot.readString();
+ struct.setErrorMessageIsSet(true);
+ }
}
}
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TGetTablesReq.java Wed Dec 18 01:48:24 2013
@@ -715,7 +715,7 @@ public class TGetTablesReq implements or
struct.tableTypes = new ArrayList<String>(_list164.size);
for (int _i165 = 0; _i165 < _list164.size; ++_i165)
{
- String _elem166; // optional
+ String _elem166; // required
_elem166 = iprot.readString();
struct.tableTypes.add(_elem166);
}
@@ -856,7 +856,7 @@ public class TGetTablesReq implements or
struct.tableTypes = new ArrayList<String>(_list169.size);
for (int _i170 = 0; _i170 < _list169.size; ++_i170)
{
- String _elem171; // optional
+ String _elem171; // required
_elem171 = iprot.readString();
struct.tableTypes.add(_elem171);
}
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionReq.java Wed Dec 18 01:48:24 2013
@@ -141,7 +141,7 @@ public class TOpenSessionReq implements
}
public TOpenSessionReq() {
- this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V3;
+ this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5;
}
@@ -188,7 +188,7 @@ public class TOpenSessionReq implements
@Override
public void clear() {
- this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V3;
+ this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5;
this.username = null;
this.password = null;
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TOpenSessionResp.java Wed Dec 18 01:48:24 2013
@@ -141,7 +141,7 @@ public class TOpenSessionResp implements
}
public TOpenSessionResp() {
- this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V4;
+ this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5;
}
@@ -191,7 +191,7 @@ public class TOpenSessionResp implements
@Override
public void clear() {
this.status = null;
- this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V4;
+ this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V5;
this.sessionHandle = null;
this.configuration = null;
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TProtocolVersion.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TProtocolVersion.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TProtocolVersion.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TProtocolVersion.java Wed Dec 18 01:48:24 2013
@@ -15,7 +15,8 @@ public enum TProtocolVersion implements
HIVE_CLI_SERVICE_PROTOCOL_V1(0),
HIVE_CLI_SERVICE_PROTOCOL_V2(1),
HIVE_CLI_SERVICE_PROTOCOL_V3(2),
- HIVE_CLI_SERVICE_PROTOCOL_V4(3);
+ HIVE_CLI_SERVICE_PROTOCOL_V4(3),
+ HIVE_CLI_SERVICE_PROTOCOL_V5(4);
private final int value;
@@ -44,6 +45,8 @@ public enum TProtocolVersion implements
return HIVE_CLI_SERVICE_PROTOCOL_V3;
case 3:
return HIVE_CLI_SERVICE_PROTOCOL_V4;
+ case 4:
+ return HIVE_CLI_SERVICE_PROTOCOL_V5;
default:
return null;
}
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRow.java Wed Dec 18 01:48:24 2013
@@ -354,7 +354,7 @@ public class TRow implements org.apache.
struct.colVals = new ArrayList<TColumnValue>(_list102.size);
for (int _i103 = 0; _i103 < _list102.size; ++_i103)
{
- TColumnValue _elem104; // optional
+ TColumnValue _elem104; // required
_elem104 = new TColumnValue();
_elem104.read(iprot);
struct.colVals.add(_elem104);
@@ -425,7 +425,7 @@ public class TRow implements org.apache.
struct.colVals = new ArrayList<TColumnValue>(_list107.size);
for (int _i108 = 0; _i108 < _list107.size; ++_i108)
{
- TColumnValue _elem109; // optional
+ TColumnValue _elem109; // required
_elem109 = new TColumnValue();
_elem109.read(iprot);
struct.colVals.add(_elem109);
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TRowSet.java Wed Dec 18 01:48:24 2013
@@ -549,7 +549,7 @@ public class TRowSet implements org.apac
struct.rows = new ArrayList<TRow>(_list110.size);
for (int _i111 = 0; _i111 < _list110.size; ++_i111)
{
- TRow _elem112; // optional
+ TRow _elem112; // required
_elem112 = new TRow();
_elem112.read(iprot);
struct.rows.add(_elem112);
@@ -568,7 +568,7 @@ public class TRowSet implements org.apac
struct.columns = new ArrayList<TColumn>(_list113.size);
for (int _i114 = 0; _i114 < _list113.size; ++_i114)
{
- TColumn _elem115; // optional
+ TColumn _elem115; // required
_elem115 = new TColumn();
_elem115.read(iprot);
struct.columns.add(_elem115);
@@ -673,7 +673,7 @@ public class TRowSet implements org.apac
struct.rows = new ArrayList<TRow>(_list120.size);
for (int _i121 = 0; _i121 < _list120.size; ++_i121)
{
- TRow _elem122; // optional
+ TRow _elem122; // required
_elem122 = new TRow();
_elem122.read(iprot);
struct.rows.add(_elem122);
@@ -687,7 +687,7 @@ public class TRowSet implements org.apac
struct.columns = new ArrayList<TColumn>(_list123.size);
for (int _i124 = 0; _i124 < _list123.size; ++_i124)
{
- TColumn _elem125; // optional
+ TColumn _elem125; // required
_elem125 = new TColumn();
_elem125.read(iprot);
struct.columns.add(_elem125);
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStatus.java Wed Dec 18 01:48:24 2013
@@ -698,7 +698,7 @@ public class TStatus implements org.apac
struct.infoMessages = new ArrayList<String>(_list126.size);
for (int _i127 = 0; _i127 < _list126.size; ++_i127)
{
- String _elem128; // optional
+ String _elem128; // required
_elem128 = iprot.readString();
struct.infoMessages.add(_elem128);
}
@@ -848,7 +848,7 @@ public class TStatus implements org.apac
struct.infoMessages = new ArrayList<String>(_list131.size);
for (int _i132 = 0; _i132 < _list131.size; ++_i132)
{
- String _elem133; // optional
+ String _elem133; // required
_elem133 = iprot.readString();
struct.infoMessages.add(_elem133);
}
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTableSchema.java Wed Dec 18 01:48:24 2013
@@ -354,7 +354,7 @@ public class TTableSchema implements org
struct.columns = new ArrayList<TColumnDesc>(_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 class TTableSchema implements org
struct.columns = new ArrayList<TColumnDesc>(_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);
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeDesc.java Wed Dec 18 01:48:24 2013
@@ -354,7 +354,7 @@ public class TTypeDesc implements org.ap
struct.types = new ArrayList<TTypeEntry>(_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 class TTypeDesc implements org.ap
struct.types = new ArrayList<TTypeEntry>(_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);
Modified: hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py (original)
+++ hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py Wed Dec 18 01:48:24 2013
@@ -21,12 +21,14 @@ class TProtocolVersion:
HIVE_CLI_SERVICE_PROTOCOL_V2 = 1
HIVE_CLI_SERVICE_PROTOCOL_V3 = 2
HIVE_CLI_SERVICE_PROTOCOL_V4 = 3
+ HIVE_CLI_SERVICE_PROTOCOL_V5 = 4
_VALUES_TO_NAMES = {
0: "HIVE_CLI_SERVICE_PROTOCOL_V1",
1: "HIVE_CLI_SERVICE_PROTOCOL_V2",
2: "HIVE_CLI_SERVICE_PROTOCOL_V3",
3: "HIVE_CLI_SERVICE_PROTOCOL_V4",
+ 4: "HIVE_CLI_SERVICE_PROTOCOL_V5",
}
_NAMES_TO_VALUES = {
@@ -34,6 +36,7 @@ class TProtocolVersion:
"HIVE_CLI_SERVICE_PROTOCOL_V2": 1,
"HIVE_CLI_SERVICE_PROTOCOL_V3": 2,
"HIVE_CLI_SERVICE_PROTOCOL_V4": 3,
+ "HIVE_CLI_SERVICE_PROTOCOL_V5": 4,
}
class TTypeId:
@@ -2607,7 +2610,7 @@ class TOpenSessionReq:
thrift_spec = (
None, # 0
- (1, TType.I32, 'client_protocol', None, 2, ), # 1
+ (1, TType.I32, 'client_protocol', None, 4, ), # 1
(2, TType.STRING, 'username', None, None, ), # 2
(3, TType.STRING, 'password', None, None, ), # 3
(4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4
@@ -2716,7 +2719,7 @@ class TOpenSessionResp:
thrift_spec = (
None, # 0
(1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
- (2, TType.I32, 'serverProtocolVersion', None, 3, ), # 2
+ (2, TType.I32, 'serverProtocolVersion', None, 4, ), # 2
(3, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 3
(4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4
)
@@ -4611,17 +4614,26 @@ class TGetOperationStatusResp:
Attributes:
- status
- operationState
+ - sqlState
+ - errorCode
+ - errorMessage
"""
thrift_spec = (
None, # 0
(1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
(2, TType.I32, 'operationState', None, None, ), # 2
+ (3, TType.STRING, 'sqlState', None, None, ), # 3
+ (4, TType.I32, 'errorCode', None, None, ), # 4
+ (5, TType.STRING, 'errorMessage', None, None, ), # 5
)
- def __init__(self, status=None, operationState=None,):
+ def __init__(self, status=None, operationState=None, sqlState=None, errorCode=None, errorMessage=None,):
self.status = status
self.operationState = operationState
+ self.sqlState = sqlState
+ self.errorCode = errorCode
+ self.errorMessage = errorMessage
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:
@@ -4643,6 +4655,21 @@ class TGetOperationStatusResp:
self.operationState = iprot.readI32();
else:
iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.sqlState = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.errorCode = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRING:
+ self.errorMessage = iprot.readString();
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -4661,6 +4688,18 @@ class TGetOperationStatusResp:
oprot.writeFieldBegin('operationState', TType.I32, 2)
oprot.writeI32(self.operationState)
oprot.writeFieldEnd()
+ if self.sqlState is not None:
+ oprot.writeFieldBegin('sqlState', TType.STRING, 3)
+ oprot.writeString(self.sqlState)
+ oprot.writeFieldEnd()
+ if self.errorCode is not None:
+ oprot.writeFieldBegin('errorCode', TType.I32, 4)
+ oprot.writeI32(self.errorCode)
+ oprot.writeFieldEnd()
+ if self.errorMessage is not None:
+ oprot.writeFieldBegin('errorMessage', TType.STRING, 5)
+ oprot.writeString(self.errorMessage)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
Modified: hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb (original)
+++ hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb Wed Dec 18 01:48:24 2013
@@ -11,8 +11,9 @@ module TProtocolVersion
HIVE_CLI_SERVICE_PROTOCOL_V2 = 1
HIVE_CLI_SERVICE_PROTOCOL_V3 = 2
HIVE_CLI_SERVICE_PROTOCOL_V4 = 3
- VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4"}
- VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4]).freeze
+ HIVE_CLI_SERVICE_PROTOCOL_V5 = 4
+ VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4", 4 => "HIVE_CLI_SERVICE_PROTOCOL_V5"}
+ VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4, HIVE_CLI_SERVICE_PROTOCOL_V5]).freeze
end
module TTypeId
@@ -778,7 +779,7 @@ class TOpenSessionReq
CONFIGURATION = 4
FIELDS = {
- CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 2, :enum_class => ::TProtocolVersion},
+ CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 4, :enum_class => ::TProtocolVersion},
USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username', :optional => true},
PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password', :optional => true},
CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}
@@ -805,7 +806,7 @@ class TOpenSessionResp
FIELDS = {
STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus},
- SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 3, :enum_class => ::TProtocolVersion},
+ SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 4, :enum_class => ::TProtocolVersion},
SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle, :optional => true},
CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}
}
@@ -1296,10 +1297,16 @@ class TGetOperationStatusResp
include ::Thrift::Struct, ::Thrift::Struct_Union
STATUS = 1
OPERATIONSTATE = 2
+ SQLSTATE = 3
+ ERRORCODE = 4
+ ERRORMESSAGE = 5
FIELDS = {
STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus},
- OPERATIONSTATE => {:type => ::Thrift::Types::I32, :name => 'operationState', :optional => true, :enum_class => ::TOperationState}
+ OPERATIONSTATE => {:type => ::Thrift::Types::I32, :name => 'operationState', :optional => true, :enum_class => ::TOperationState},
+ SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'sqlState', :optional => true},
+ ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :optional => true},
+ ERRORMESSAGE => {:type => ::Thrift::Types::STRING, :name => 'errorMessage', :optional => true}
}
def struct_fields; FIELDS; end
Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java Wed Dec 18 01:48:24 2013
@@ -123,9 +123,9 @@ public class CLIService extends Composit
*/
@Override
public SessionHandle openSessionWithImpersonation(String username, String password, Map<String, String> configuration,
- String delegationToken) throws HiveSQLException {
+ String delegationToken) throws HiveSQLException {
SessionHandle sessionHandle = sessionManager.openSession(username, password, configuration,
- true, delegationToken);
+ true, delegationToken);
LOG.info(sessionHandle + ": openSession()");
return sessionHandle;
}
@@ -146,7 +146,8 @@ public class CLIService extends Composit
@Override
public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType)
throws HiveSQLException {
- GetInfoValue infoValue = sessionManager.getSession(sessionHandle).getInfo(getInfoType);
+ GetInfoValue infoValue = sessionManager.getSession(sessionHandle)
+ .getInfo(getInfoType);
LOG.info(sessionHandle + ": getInfo()");
return infoValue;
}
@@ -158,7 +159,7 @@ public class CLIService extends Composit
@Override
public OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay)
- throws HiveSQLException {
+ throws HiveSQLException {
OperationHandle opHandle = sessionManager.getSession(sessionHandle)
.executeStatement(statement, confOverlay);
LOG.info(sessionHandle + ": executeStatement()");
@@ -185,7 +186,8 @@ public class CLIService extends Composit
@Override
public OperationHandle getTypeInfo(SessionHandle sessionHandle)
throws HiveSQLException {
- OperationHandle opHandle = sessionManager.getSession(sessionHandle).getTypeInfo();
+ OperationHandle opHandle = sessionManager.getSession(sessionHandle)
+ .getTypeInfo();
LOG.info(sessionHandle + ": getTypeInfo()");
return opHandle;
}
@@ -196,7 +198,8 @@ public class CLIService extends Composit
@Override
public OperationHandle getCatalogs(SessionHandle sessionHandle)
throws HiveSQLException {
- OperationHandle opHandle = sessionManager.getSession(sessionHandle).getCatalogs();
+ OperationHandle opHandle = sessionManager.getSession(sessionHandle)
+ .getCatalogs();
LOG.info(sessionHandle + ": getCatalogs()");
return opHandle;
}
@@ -207,7 +210,7 @@ public class CLIService extends Composit
@Override
public OperationHandle getSchemas(SessionHandle sessionHandle,
String catalogName, String schemaName)
- throws HiveSQLException {
+ throws HiveSQLException {
OperationHandle opHandle = sessionManager.getSession(sessionHandle)
.getSchemas(catalogName, schemaName);
LOG.info(sessionHandle + ": getSchemas()");
@@ -220,9 +223,9 @@ public class CLIService extends Composit
@Override
public OperationHandle getTables(SessionHandle sessionHandle,
String catalogName, String schemaName, String tableName, List<String> tableTypes)
- throws HiveSQLException {
- OperationHandle opHandle = sessionManager
- .getSession(sessionHandle).getTables(catalogName, schemaName, tableName, tableTypes);
+ throws HiveSQLException {
+ OperationHandle opHandle = sessionManager.getSession(sessionHandle)
+ .getTables(catalogName, schemaName, tableName, tableTypes);
LOG.info(sessionHandle + ": getTables()");
return opHandle;
}
@@ -233,7 +236,8 @@ public class CLIService extends Composit
@Override
public OperationHandle getTableTypes(SessionHandle sessionHandle)
throws HiveSQLException {
- OperationHandle opHandle = sessionManager.getSession(sessionHandle).getTableTypes();
+ OperationHandle opHandle = sessionManager.getSession(sessionHandle)
+ .getTableTypes();
LOG.info(sessionHandle + ": getTableTypes()");
return opHandle;
}
@@ -244,7 +248,7 @@ public class CLIService extends Composit
@Override
public OperationHandle getColumns(SessionHandle sessionHandle,
String catalogName, String schemaName, String tableName, String columnName)
- throws HiveSQLException {
+ throws HiveSQLException {
OperationHandle opHandle = sessionManager.getSession(sessionHandle)
.getColumns(catalogName, schemaName, tableName, columnName);
LOG.info(sessionHandle + ": getColumns()");
@@ -257,7 +261,7 @@ public class CLIService extends Composit
@Override
public OperationHandle getFunctions(SessionHandle sessionHandle,
String catalogName, String schemaName, String functionName)
- throws HiveSQLException {
+ throws HiveSQLException {
OperationHandle opHandle = sessionManager.getSession(sessionHandle)
.getFunctions(catalogName, schemaName, functionName);
LOG.info(sessionHandle + ": getFunctions()");
@@ -268,11 +272,12 @@ public class CLIService extends Composit
* @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle)
*/
@Override
- public OperationState getOperationStatus(OperationHandle opHandle)
+ public OperationStatus getOperationStatus(OperationHandle opHandle)
throws HiveSQLException {
- OperationState opState = sessionManager.getOperationManager().getOperationState(opHandle);
+ OperationStatus opStatus = sessionManager.getOperationManager()
+ .getOperationStatus(opHandle);
LOG.info(opHandle + ": getOperationStatus()");
- return opState;
+ return opStatus;
}
/* (non-Javadoc)
@@ -281,8 +286,8 @@ public class CLIService extends Composit
@Override
public void cancelOperation(OperationHandle opHandle)
throws HiveSQLException {
- sessionManager.getOperationManager().getOperation(opHandle).
- getParentSession().cancelOperation(opHandle);
+ sessionManager.getOperationManager().getOperation(opHandle)
+ .getParentSession().cancelOperation(opHandle);
LOG.info(opHandle + ": cancelOperation()");
}
@@ -292,8 +297,8 @@ public class CLIService extends Composit
@Override
public void closeOperation(OperationHandle opHandle)
throws HiveSQLException {
- sessionManager.getOperationManager().getOperation(opHandle).
- getParentSession().closeOperation(opHandle);
+ sessionManager.getOperationManager().getOperation(opHandle)
+ .getParentSession().closeOperation(opHandle);
LOG.info(opHandle + ": closeOperation");
}
@@ -303,8 +308,8 @@ public class CLIService extends Composit
@Override
public TableSchema getResultSetMetadata(OperationHandle opHandle)
throws HiveSQLException {
- TableSchema tableSchema = sessionManager.getOperationManager().getOperation(opHandle).
- getParentSession().getResultSetMetadata(opHandle);
+ TableSchema tableSchema = sessionManager.getOperationManager()
+ .getOperation(opHandle).getParentSession().getResultSetMetadata(opHandle);
LOG.info(opHandle + ": getResultSetMetadata()");
return tableSchema;
}
@@ -315,8 +320,8 @@ public class CLIService extends Composit
@Override
public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows)
throws HiveSQLException {
- RowSet rowSet = sessionManager.getOperationManager().getOperation(opHandle).
- getParentSession().fetchResults(opHandle, orientation, maxRows);
+ RowSet rowSet = sessionManager.getOperationManager().getOperation(opHandle)
+ .getParentSession().fetchResults(opHandle, orientation, maxRows);
LOG.info(opHandle + ": fetchResults()");
return rowSet;
}
@@ -327,8 +332,8 @@ public class CLIService extends Composit
@Override
public RowSet fetchResults(OperationHandle opHandle)
throws HiveSQLException {
- RowSet rowSet = sessionManager.getOperationManager().getOperation(opHandle).
- getParentSession().fetchResults(opHandle);
+ RowSet rowSet = sessionManager.getOperationManager().getOperation(opHandle)
+ .getParentSession().fetchResults(opHandle);
LOG.info(opHandle + ": fetchResults()");
return rowSet;
}
@@ -339,7 +344,7 @@ public class CLIService extends Composit
if (!hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL) ||
!hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)) {
throw new UnsupportedOperationException(
- "delegation token is can only be obtained for a secure remote metastore");
+ "delegation token is can only be obtained for a secure remote metastore");
}
try {
Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/CLIServiceClient.java Wed Dec 18 01:48:24 2013
@@ -19,8 +19,6 @@
package org.apache.hive.service.cli;
import java.util.Collections;
-import java.util.List;
-import java.util.Map;
/**
@@ -29,127 +27,12 @@ import java.util.Map;
*/
public abstract class CLIServiceClient implements ICLIService {
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map)
- */
- @Override
- public abstract SessionHandle openSession(String username, String password,
- Map<String, String> configuration) throws HiveSQLException;
-
-
public SessionHandle openSession(String username, String password)
throws HiveSQLException {
return openSession(username, password, Collections.<String, String>emptyMap());
}
/* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle)
- */
- @Override
- public abstract void closeSession(SessionHandle sessionHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List)
- */
- @Override
- public abstract GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType)
- throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle,
- * java.lang.String, java.util.Map)
- */
- @Override
- public abstract OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
- Map<String, String> confOverlay) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#executeStatementAsync(org.apache.hive.service.cli.SessionHandle,
- * java.lang.String, java.util.Map)
- */
- @Override
- public abstract OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement,
- Map<String, String> confOverlay) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle)
- */
- @Override
- public abstract OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getCatalogs(org.apache.hive.service.cli.SessionHandle)
- */
- @Override
- public abstract OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String)
- */
- @Override
- public abstract OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName,
- String schemaName) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List)
- */
- @Override
- public abstract OperationHandle getTables(SessionHandle sessionHandle, String catalogName,
- String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle)
- */
- @Override
- public abstract OperationHandle getTableTypes(SessionHandle sessionHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
- */
- @Override
- public abstract OperationHandle getColumns(SessionHandle sessionHandle, String catalogName,
- String schemaName, String tableName, String columnName) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getFunctions(org.apache.hive.service.cli.SessionHandle, java.lang.String)
- */
- @Override
- public abstract OperationHandle getFunctions(SessionHandle sessionHandle,
- String catalogName, String schemaName, String functionName)
- throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle)
- */
- @Override
- public abstract OperationState getOperationStatus(OperationHandle opHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle)
- */
- @Override
- public abstract void cancelOperation(OperationHandle opHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#closeOperation(org.apache.hive.service.cli.OperationHandle)
- */
- @Override
- public abstract void closeOperation(OperationHandle opHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle)
- */
- @Override
- public abstract TableSchema getResultSetMetadata(OperationHandle opHandle) throws HiveSQLException;
-
- /* (non-Javadoc)
- * @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle, org.apache.hive.service.cli.FetchOrientation, long)
- */
- @Override
- public abstract RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows)
- throws HiveSQLException;
-
- /* (non-Javadoc)
* @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle)
*/
@Override
Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java Wed Dec 18 01:48:24 2013
@@ -143,7 +143,7 @@ public class EmbeddedCLIServiceClient ex
@Override
public OperationHandle getFunctions(SessionHandle sessionHandle,
String catalogName, String schemaName, String functionName)
- throws HiveSQLException {
+ throws HiveSQLException {
return cliService.getFunctions(sessionHandle, catalogName, schemaName, functionName);
}
@@ -151,7 +151,7 @@ public class EmbeddedCLIServiceClient ex
* @see org.apache.hive.service.cli.CLIServiceClient#getOperationStatus(org.apache.hive.service.cli.OperationHandle)
*/
@Override
- public OperationState getOperationStatus(OperationHandle opHandle) throws HiveSQLException {
+ public OperationStatus getOperationStatus(OperationHandle opHandle) throws HiveSQLException {
return cliService.getOperationStatus(opHandle);
}
Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/ICLIService.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/ICLIService.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/ICLIService.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/ICLIService.java Wed Dec 18 01:48:24 2013
@@ -27,11 +27,11 @@ public interface ICLIService {
public abstract SessionHandle openSession(String username, String password,
Map<String, String> configuration)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract SessionHandle openSessionWithImpersonation(String username, String password,
Map<String, String> configuration, String delegationToken)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract void closeSession(SessionHandle sessionHandle)
throws HiveSQLException;
@@ -41,11 +41,11 @@ public interface ICLIService {
public abstract OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract OperationHandle executeStatementAsync(SessionHandle sessionHandle,
String statement, Map<String, String> confOverlay)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract OperationHandle getTypeInfo(SessionHandle sessionHandle)
throws HiveSQLException;
@@ -55,24 +55,24 @@ public interface ICLIService {
public abstract OperationHandle getSchemas(SessionHandle sessionHandle,
String catalogName, String schemaName)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract OperationHandle getTables(SessionHandle sessionHandle,
String catalogName, String schemaName, String tableName, List<String> tableTypes)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract OperationHandle getTableTypes(SessionHandle sessionHandle)
throws HiveSQLException;
public abstract OperationHandle getColumns(SessionHandle sessionHandle,
String catalogName, String schemaName, String tableName, String columnName)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract OperationHandle getFunctions(SessionHandle sessionHandle,
String catalogName, String schemaName, String functionName)
- throws HiveSQLException;
+ throws HiveSQLException;
- public abstract OperationState getOperationStatus(OperationHandle opHandle)
+ public abstract OperationStatus getOperationStatus(OperationHandle opHandle)
throws HiveSQLException;
public abstract void cancelOperation(OperationHandle opHandle)
@@ -86,7 +86,7 @@ public interface ICLIService {
public abstract RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation,
long maxRows)
- throws HiveSQLException;
+ throws HiveSQLException;
public abstract RowSet fetchResults(OperationHandle opHandle)
throws HiveSQLException;
Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/OperationState.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/OperationState.java?rev=1551801&r1=1551800&r2=1551801&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/OperationState.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/OperationState.java Wed Dec 18 01:48:24 2013
@@ -94,7 +94,7 @@ public enum OperationState {
}
public void validateTransition(OperationState newState)
- throws HiveSQLException {
+ throws HiveSQLException {
validateTransition(this, newState);
}
Added: hive/trunk/service/src/java/org/apache/hive/service/cli/OperationStatus.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/OperationStatus.java?rev=1551801&view=auto
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/OperationStatus.java (added)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/OperationStatus.java Wed Dec 18 01:48:24 2013
@@ -0,0 +1,43 @@
+/**
+ * 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;
+
+/**
+ * OperationStatus
+ *
+ */
+public class OperationStatus {
+
+ private final OperationState state;
+ private final HiveSQLException operationException;
+
+ public OperationStatus(OperationState state, HiveSQLException operationException) {
+ this.state = state;
+ this.operationException = operationException;
+ }
+
+ public OperationState getState() {
+ return state;
+ }
+
+ public HiveSQLException getOperationException() {
+ return operationException;
+ }
+
+}