Class DatabricksThriftUtil
java.lang.Object
com.databricks.jdbc.common.util.DatabricksThriftUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbyteBufferToString(ByteBuffer buffer) static voidcheckDirectResultsForErrorStatus(TSparkDirectResults directResults, String context, String statementId) convertColumnarToRowBased(TFetchResultsResp resultsResp, IDatabricksStatementInternal parentStatement, IDatabricksSession session) static ColumnarRowViewcreateColumnarView(TRowSet rowSet) Memory-efficient alternative that creates a columnar view instead of materializing all rows.static ExternalLinkcreateExternalLink(TSparkArrowResultLink chunkInfo, long chunkIndex) 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 ColumnInfogetColumnInfoFromTColumnDesc(TColumnDesc columnDesc) static TNamespacegetNamespace(String catalog, String schema) static TOperationHandlegetOperationHandle(StatementId statementId) static longgetRowCount(TRowSet resultData) static StatementStatusReturns statement status for given operation status responsestatic StringgetTypeTextFromTypeDesc(TTypeDesc typeDesc) static voidverifySuccessStatus(TStatus status, String errorContext) static voidverifySuccessStatus(TStatus status, String errorContext, String statementId)
-
Constructor Details
-
DatabricksThriftUtil
public DatabricksThriftUtil()
-
-
Method Details
-
getNamespace
-
byteBufferToString
-
createExternalLink
-
verifySuccessStatus
public static void verifySuccessStatus(TStatus status, String errorContext) throws DatabricksHttpException - Throws:
DatabricksHttpException
-
verifySuccessStatus
public static void verifySuccessStatus(TStatus status, String errorContext, String statementId) throws DatabricksHttpException - Throws:
DatabricksHttpException
-
getColumnCount
-
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
-
createColumnarView
Memory-efficient alternative that creates a columnar view instead of materializing all rows. Use this method to significantly reduce memory allocations when accessing row data.- Parameters:
rowSet- that contains columnar data- Returns:
- a columnar view that provides row-based access without full materialization
- Throws:
DatabricksSQLException
-
getStatementStatus
Returns statement status for given operation status response -
getAsyncStatus
Returns statement status for given status response -
getTypeTextFromTypeDesc
-
getColumnInfoFromTColumnDesc
-
convertColumnarToRowBased
public static List<List<Object>> convertColumnarToRowBased(TFetchResultsResp resultsResp, IDatabricksStatementInternal parentStatement, IDatabricksSession session) throws DatabricksSQLException - Throws:
DatabricksSQLException
-
getOperationHandle
-
getRowCount
- Throws:
DatabricksSQLException
-
checkDirectResultsForErrorStatus
public static void checkDirectResultsForErrorStatus(TSparkDirectResults directResults, String context, String statementId) throws DatabricksHttpException - Throws:
DatabricksHttpException
-