Package com.databricks.jdbc.common.util
Class DatabricksThriftUtil
- java.lang.Object
-
- com.databricks.jdbc.common.util.DatabricksThriftUtil
-
public class DatabricksThriftUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description DatabricksThriftUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbyteBufferToString(ByteBuffer buffer)static voidcheckDirectResultsForErrorStatus(TSparkDirectResults directResults, String context)static List<List<Object>>convertColumnarToRowBased(TFetchResultsResp resultsResp, IDatabricksStatementInternal parentStatement, IDatabricksSession session)static ExternalLinkcreateExternalLink(TSparkArrowResultLink chunkInfo, long chunkIndex)static List<List<Object>>extractRowsFromColumnar(TRowSet rowSet)This functions extracts columnar data from a RowSet into rowsstatic StatementStatusgetAsyncStatus(TStatus status)Returns statement status for given status responsestatic intgetColumnCount(TGetResultSetMetadataResp resultManifest)static TNamespacegetNamespace(String catalog, String schema)static TOperationHandlegetOperationHandle(StatementId statementId)static longgetRowCount(TRowSet resultData)static StatementStatusgetStatementStatus(TGetOperationStatusResp resp)Returns statement status for given operation status responsestatic com.databricks.sdk.service.sql.ColumnInfoTypeNamegetTypeFromTypeDesc(TTypeDesc typeDesc)static StringgetTypeTextFromTypeDesc(TTypeDesc typeDesc)static voidverifySuccessStatus(TStatus status, String errorContext)
-
-
-
Method Detail
-
getNamespace
public static TNamespace getNamespace(String catalog, String schema)
-
byteBufferToString
public static String byteBufferToString(ByteBuffer buffer)
-
createExternalLink
public static ExternalLink createExternalLink(TSparkArrowResultLink chunkInfo, long chunkIndex)
-
verifySuccessStatus
public static void verifySuccessStatus(TStatus status, String errorContext) throws DatabricksHttpException
- Throws:
DatabricksHttpException
-
getColumnCount
public static int getColumnCount(TGetResultSetMetadataResp resultManifest)
-
extractRowsFromColumnar
public static List<List<Object>> extractRowsFromColumnar(TRowSet rowSet) throws DatabricksSQLException
This functions extracts columnar data from a RowSet into rows- Parameters:
rowSet- that contains columnar data- Returns:
- a list of rows
- Throws:
DatabricksSQLException
-
getStatementStatus
public static StatementStatus getStatementStatus(TGetOperationStatusResp resp)
Returns statement status for given operation status response
-
getAsyncStatus
public static StatementStatus getAsyncStatus(TStatus status)
Returns statement status for given status response
-
getTypeFromTypeDesc
public static com.databricks.sdk.service.sql.ColumnInfoTypeName getTypeFromTypeDesc(TTypeDesc typeDesc)
-
convertColumnarToRowBased
public static List<List<Object>> convertColumnarToRowBased(TFetchResultsResp resultsResp, IDatabricksStatementInternal parentStatement, IDatabricksSession session) throws DatabricksSQLException
- Throws:
DatabricksSQLException
-
getOperationHandle
public static TOperationHandle getOperationHandle(StatementId statementId)
-
getRowCount
public static long getRowCount(TRowSet resultData) throws DatabricksSQLException
- Throws:
DatabricksSQLException
-
checkDirectResultsForErrorStatus
public static void checkDirectResultsForErrorStatus(TSparkDirectResults directResults, String context) throws DatabricksHttpException
- Throws:
DatabricksHttpException
-
-