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
`DatabricksThriftUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `byteBufferToString​(ByteBuffer buffer)`
`static void` `checkDirectResultsForErrorStatus​(TSparkDirectResults directResults, String context, String statementId)`
`static List<List<Object>>` `convertColumnarToRowBased​(TFetchResultsResp resultsResp, IDatabricksStatementInternal parentStatement, IDatabricksSession session)`
`static ColumnarRowView` `createColumnarView​(TRowSet rowSet)` Memory-efficient alternative that creates a columnar view instead of materializing all rows.
`static ExternalLink` `createExternalLink​(TSparkArrowResultLink chunkInfo, long chunkIndex)`
`static List<List<Object>>` `extractRowsFromColumnar​(TRowSet rowSet)` This functions extracts columnar data from a RowSet into rows
`static StatementStatus` `getAsyncStatus​(TStatus status)` Returns statement status for given status response
`static int` `getColumnCount​(TGetResultSetMetadataResp resultManifest)`
`static ColumnInfo` `getColumnInfoFromTColumnDesc​(TColumnDesc columnDesc)`
`static TNamespace` `getNamespace​(String catalog, String schema)`
`static TOperationHandle` `getOperationHandle​(StatementId statementId)`
`static long` `getRowCount​(TRowSet resultData)`
`static StatementStatus` `getStatementStatus​(TGetOperationStatusResp resp)` Returns statement status for given operation status response
`static String` `getTypeTextFromTypeDesc​(TTypeDesc typeDesc)`
`static void` `verifySuccessStatus​(TStatus status, String errorContext)`
`static void` `verifySuccessStatus​(TStatus status, String errorContext, String statementId)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DatabricksThriftUtil

    public DatabricksThriftUtil()

### 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`

#### verifySuccessStatus

    public static void verifySuccessStatus​(TStatus status,
                                           String errorContext,
                                           String statementId)
                                    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`

#### createColumnarView

    public static ColumnarRowView createColumnarView​(TRowSet rowSet)
                                              throws DatabricksSQLException

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

    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

#### getTypeTextFromTypeDesc

    public static String getTypeTextFromTypeDesc​(TTypeDesc typeDesc)

#### getColumnInfoFromTColumnDesc

    public static ColumnInfo getColumnInfoFromTColumnDesc​(TColumnDesc columnDesc)

#### 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,
                                                        String statementId)
                                                 throws DatabricksHttpException

Throws:
  `DatabricksHttpException`