Timestamp Function Support

The Simba Apache Spark ODBC Connector supports the following ODBC functions for working with data of type TIMESTAMP:

  • TIMESTAMPADD: You can call this function to increment a TIMESTAMP value by a specified interval of time.
  • TIMESTAMPDIFF: You can call this function to calculate the interval of time between two specified TIMESTAMP values.

The types of time intervals that are supported for these functions might vary depending on the Spark server version that you are connecting to. To return a list of the intervals supported for TIMESTAMPADD, call the SQLGetInfo catalog function using SQL_TIMEDATE_ADD_INTERVALS as the argument. Similarly, to return a list of the intervals supported for TIMESTAMPDIFF, call SQLGetInfo using SQL_TIMEDATE_DIFF_INTERVALS as the argument.

Note:

The SQL_TSI_FRAC_SECOND interval is not supported by Spark.