Created
October 25, 2019 15:39
-
-
Save kgorman/e57324ae7afa5504b843039e758a05bd to your computer and use it in GitHub Desktop.
sample3.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- eventTimestamp is the Kafka timestamp | |
-- as unix timestamp. Magically added to every schema. | |
SELECT max(eventTimestamp) FROM solar_inputs; | |
-- make it human readable | |
SELECT CAST(max(eventTimestamp) AS varchar) as TS FROM solar_inputs; | |
-- dete math with interval | |
SELECT * FROM payments | |
WHERE eventTimestamp > CURRENT_TIMESTAMP-interval '10' second; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment