Class TimestampConverter
- java.lang.Object
-
- com.databricks.jdbc.api.impl.converters.TimestampConverter
-
- All Implemented Interfaces:
ObjectConverter
public class TimestampConverter extends Object implements ObjectConverter
-
-
Field Summary
-
Fields inherited from interface com.databricks.jdbc.api.impl.converters.ObjectConverter
DEFAULT_TIMESTAMP_SCALE, POWERS_OF_TEN
-
-
Constructor Summary
Constructors Constructor Description TimestampConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigIntegertoBigInteger(Object object)DatetoDate(Object object)longtoLong(Object object)StringtoString(Object object)TimetoTime(Object object)TimestamptoTimestamp(Object object)Converts an object to aTimestamp.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.databricks.jdbc.api.impl.converters.ObjectConverter
toAsciiStream, toBigDecimal, toBigDecimal, toBinaryStream, toBoolean, toByte, toByteArray, toChar, toCharacterStream, toDatabricksArray, toDatabricksMap, toDatabricksStruct, toDouble, toFloat, toInt, toLocalDate, toShort, toTimestamp, toUnicodeStream
-
-
-
-
Method Detail
-
toTime
public Time toTime(Object object) throws DatabricksSQLException
- Specified by:
toTimein interfaceObjectConverter- Throws:
DatabricksSQLException
-
toTimestamp
public Timestamp toTimestamp(Object object) throws DatabricksSQLException
Converts an object to aTimestamp.The method supports various input formats depending on the mode:
- timestamp_ntz:
- Thrift Arrow:
timestamp yyyy-MM-dd HH:mm:ss.S - Thrift Inline:
yyyy-MM-dd HH:mm:ss.S(String) - Sea Inline:
yyyy-MM-dd'T'HH:mm:ss.SSS(String) - Sea Arrow:
timestamp yyyy-MM-dd HH:mm:ss.S
- Thrift Arrow:
- Timestamp:
- Thrift Arrow:
timestamp yyyy-MM-dd HH:mm:ss.S - Thrift Inline:
yyyy-MM-dd HH:mm:ss(String) - Sea Inline:
yyyy-MM-dd'T'HH:mm:ss.SSSXXX(String) - Sea Arrow:
yyyy-MM-dd HH:mm:ss.S
- Thrift Arrow:
- Specified by:
toTimestampin interfaceObjectConverter- Parameters:
object- the object to convert- Returns:
- the converted
Timestamp - Throws:
DatabricksSQLException- if the conversion fails
- timestamp_ntz:
-
toLong
public long toLong(Object object) throws DatabricksSQLException
- Specified by:
toLongin interfaceObjectConverter- Throws:
DatabricksSQLException
-
toBigInteger
public BigInteger toBigInteger(Object object) throws DatabricksSQLException
- Specified by:
toBigIntegerin interfaceObjectConverter- Throws:
DatabricksSQLException
-
toString
public String toString(Object object) throws DatabricksSQLException
- Specified by:
toStringin interfaceObjectConverter- Throws:
DatabricksSQLException
-
toDate
public Date toDate(Object object) throws DatabricksSQLException
- Specified by:
toDatein interfaceObjectConverter- Throws:
DatabricksSQLException
-
-