public class ThriftObjectConversions extends Object
Constructor and Description |
---|
ThriftObjectConversions() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hive.service.rpc.thrift.TRowSet |
toColumnBasedSet(List<LogicalType> fieldTypes,
List<RowData.FieldGetter> fieldGetters,
List<RowData> rows) |
static FetchOrientation |
toFetchOrientation(org.apache.hive.service.rpc.thrift.TFetchOrientation fetchOrientation) |
static Set<CatalogBaseTable.TableKind> |
toFlinkTableKinds(List<String> tableTypes)
Counterpart of the
org.apache.hive.service.cli.operation.TableTypeMapping . |
static OperationHandle |
toOperationHandle(org.apache.hive.service.rpc.thrift.TOperationHandle tOperationHandle) |
static org.apache.hive.service.rpc.thrift.TRowSet |
toRowBasedSet(List<LogicalType> fieldTypes,
List<RowData.FieldGetter> fieldGetters,
List<RowData> rows) |
static SessionHandle |
toSessionHandle(org.apache.hive.service.rpc.thrift.TOperationHandle tOperationHandle) |
static SessionHandle |
toSessionHandle(org.apache.hive.service.rpc.thrift.TSessionHandle tSessionHandle) |
static org.apache.hive.service.rpc.thrift.TOperationHandle |
toTOperationHandle(SessionHandle sessionHandle,
OperationHandle operationHandle,
org.apache.hive.service.rpc.thrift.TOperationType operationType)
|
static org.apache.hive.service.rpc.thrift.TOperationState |
toTOperationState(OperationStatus operationStatus) |
static org.apache.hive.service.rpc.thrift.TRowSet |
toTRowSet(org.apache.hive.service.rpc.thrift.TProtocolVersion version,
ResolvedSchema schema,
List<RowData> data)
Similar to
SerDeUtils.toThriftPayload(Object, ObjectInspector, int) that converts the
returned Rows to JSON string. |
static org.apache.hive.service.rpc.thrift.TSessionHandle |
toTSessionHandle(SessionHandle sessionHandle) |
static org.apache.hive.service.rpc.thrift.TStatus |
toTStatus(Throwable t) |
static org.apache.hive.service.rpc.thrift.TTableSchema |
toTTableSchema(ResolvedSchema schema)
Similar logic in the
org.apache.hive.service.cli.ColumnDescriptor . |
public static org.apache.hive.service.rpc.thrift.TSessionHandle toTSessionHandle(SessionHandle sessionHandle)
public static SessionHandle toSessionHandle(org.apache.hive.service.rpc.thrift.TSessionHandle tSessionHandle)
public static org.apache.hive.service.rpc.thrift.TOperationHandle toTOperationHandle(SessionHandle sessionHandle, OperationHandle operationHandle, org.apache.hive.service.rpc.thrift.TOperationType operationType)
SessionHandle
and OperationHandle
to TOperationHandle
.
Hive uses TOperationHandle
to retrieve the Operation
related information.
However, SqlGateway uses SessionHandle
and OperationHandle
to determine.
Therefore, the TOperationHandle
needs to contain both SessionHandle
and
OperationHandle
.
Currently all operations in the SqlGatewayService
has data. Therefore, set the
TOperationHandle#hasResultSet
true.
public static SessionHandle toSessionHandle(org.apache.hive.service.rpc.thrift.TOperationHandle tOperationHandle)
public static OperationHandle toOperationHandle(org.apache.hive.service.rpc.thrift.TOperationHandle tOperationHandle)
public static org.apache.hive.service.rpc.thrift.TOperationState toTOperationState(OperationStatus operationStatus)
public static FetchOrientation toFetchOrientation(org.apache.hive.service.rpc.thrift.TFetchOrientation fetchOrientation)
public static org.apache.hive.service.rpc.thrift.TTableSchema toTTableSchema(ResolvedSchema schema)
org.apache.hive.service.cli.ColumnDescriptor
.public static org.apache.hive.service.rpc.thrift.TRowSet toTRowSet(org.apache.hive.service.rpc.thrift.TProtocolVersion version, ResolvedSchema schema, List<RowData> data)
SerDeUtils.toThriftPayload(Object, ObjectInspector, int)
that converts the
returned Rows to JSON string. The only difference is the current implementation also keep the
type for primitive type.public static Set<CatalogBaseTable.TableKind> toFlinkTableKinds(@Nullable List<String> tableTypes)
org.apache.hive.service.cli.operation.TableTypeMapping
.public static org.apache.hive.service.rpc.thrift.TStatus toTStatus(Throwable t)
@VisibleForTesting public static org.apache.hive.service.rpc.thrift.TRowSet toColumnBasedSet(List<LogicalType> fieldTypes, List<RowData.FieldGetter> fieldGetters, List<RowData> rows)
@VisibleForTesting public static org.apache.hive.service.rpc.thrift.TRowSet toRowBasedSet(List<LogicalType> fieldTypes, List<RowData.FieldGetter> fieldGetters, List<RowData> rows)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.