I'm trying to covert a timestamp to seconds in apache drill and can only find functions to extract the number of seconds in a timestamp instead rather than the timestamp converted to seconds.
I'm doing this to get the difference between dates to calculate the time between them.
The answer was to convert the date to UNIX_TIMESTAMP.
SELECT UNIX_TIMESTAMP('2015-05-29 08:18:53.0', 'yyyy-MM-dd HH:mm:ss.SSS') FROM (VALUES(1));
+-------------+
| EXPR$0 |
+-------------+
| 1432912733 |
+-------------+