Package com.databricks.jdbc.common.util

## Class DatabricksTypeUtil

- java.lang.Object
- - com.databricks.jdbc.common.util.DatabricksTypeUtil

    public class DatabricksTypeUtil
    extends Object

Utility class for handling various type conversions and mappings between Databricks-specific data types, SQL types, and Arrow types.

### Field Summary

Fields
`static String` `ARRAY`
`static String` `BIGINT`
`static String` `BINARY`
`static String` `BOOLEAN`
`static String` `BYTE`
`static String` `DATE`
`static String` `DECIMAL`
`static String` `DOUBLE`
`static String` `FLOAT`
`static String` `INT`
`static String` `MAP`
`static String` `NULL`
`static String` `SMALLINT`
`static String` `STRING`
`static String` `STRUCT`
`static String` `TIMESTAMP`
`static String` `TIMESTAMP_NTZ`
`static String` `TINYINT`
`static String` `VOID`

### Constructor Summary

Constructors
`DatabricksTypeUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static com.databricks.sdk.service.sql.ColumnInfoTypeName` `getColumnInfoType​(String typeName)`
`static int` `getColumnType​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName)`
`static String` `getColumnTypeClassName​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName)`
`static String` `getDatabricksTypeFromSQLType​(int sqlType)` Converts SQL type into Databricks type as defined here
`static int` `getDisplaySize​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName, int precision)`
`static Nullable` `getNullableFromValue​(Integer isNullable)`
`static int` `getPrecision​(Integer columnType)`
`static int` `getScale​(Integer columnType)`
`static TTypeId` `getThriftTypeFromTypeDesc​(TTypeDesc typeDesc)`
`static String` `inferDatabricksType​(Object obj)` Infers Databricks type from class of given object as defined in here
`static boolean` `isSigned​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName)`
`static org.apache.arrow.vector.types.pojo.ArrowType` `mapThriftToArrowType​(TTypeId typeId)`

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

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

### Field Detail

#### BIGINT

    public static final String BIGINT

See Also:
  Constant Field Values

#### BINARY

    public static final String BINARY

See Also:
  Constant Field Values

#### BOOLEAN

    public static final String BOOLEAN

See Also:
  Constant Field Values

#### DATE

    public static final String DATE

See Also:
  Constant Field Values

#### DECIMAL

    public static final String DECIMAL

See Also:
  Constant Field Values

#### DOUBLE

    public static final String DOUBLE

See Also:
  Constant Field Values

#### FLOAT

    public static final String FLOAT

See Also:
  Constant Field Values

#### INT

    public static final String INT

See Also:
  Constant Field Values

#### BYTE

    public static final String BYTE

See Also:
  Constant Field Values

#### VOID

    public static final String VOID

See Also:
  Constant Field Values

#### SMALLINT

    public static final String SMALLINT

See Also:
  Constant Field Values

#### NULL

    public static final String NULL

See Also:
  Constant Field Values

#### STRING

    public static final String STRING

See Also:
  Constant Field Values

#### TINYINT

    public static final String TINYINT

See Also:
  Constant Field Values

#### TIMESTAMP

    public static final String TIMESTAMP

See Also:
  Constant Field Values

#### TIMESTAMP_NTZ

    public static final String TIMESTAMP_NTZ

See Also:
  Constant Field Values

#### MAP

    public static final String MAP

See Also:
  Constant Field Values

#### ARRAY

    public static final String ARRAY

See Also:
  Constant Field Values

#### STRUCT

    public static final String STRUCT

See Also:
  Constant Field Values

### Constructor Detail

#### DatabricksTypeUtil

    public DatabricksTypeUtil()

### Method Detail

#### getColumnInfoType

    public static com.databricks.sdk.service.sql.ColumnInfoTypeName getColumnInfoType​(String typeName)

#### getColumnType

    public static int getColumnType​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName)

#### getColumnTypeClassName

    public static String getColumnTypeClassName​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName)

#### getDisplaySize

    public static int getDisplaySize​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName,
                                     int precision)

#### getPrecision

    public static int getPrecision​(Integer columnType)

#### getScale

    public static int getScale​(Integer columnType)

#### isSigned

    public static boolean isSigned​(com.databricks.sdk.service.sql.ColumnInfoTypeName typeName)

#### getNullableFromValue

    public static Nullable getNullableFromValue​(Integer isNullable)

#### getDatabricksTypeFromSQLType

    public static String getDatabricksTypeFromSQLType​(int sqlType)

Converts SQL type into Databricks type as defined here

Parameters:
  `sqlType` - SQL type input
Returns:
  databricks type

#### inferDatabricksType

    public static String inferDatabricksType​(Object obj)

Infers Databricks type from class of given object as defined in here

Parameters:
  `obj` - input object
Returns:
  inferred Databricks type

#### getThriftTypeFromTypeDesc

    public static TTypeId getThriftTypeFromTypeDesc​(TTypeDesc typeDesc)

#### mapThriftToArrowType

    public static org.apache.arrow.vector.types.pojo.ArrowType mapThriftToArrowType​(TTypeId typeId)
                                                                             throws SQLException

Throws:
  `SQLException`