Skip to content

Instantly share code, notes, and snippets.

@minudika
Last active July 21, 2019 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minudika/7846e7633c7b8ed954d377b4e2c86e1e to your computer and use it in GitHub Desktop.
Save minudika/7846e7633c7b8ed954d377b4e2c86e1e to your computer and use it in GitHub Desktop.
from InputStream#rdbms:query('IS_ANALYTICS_DB', 'select hour(FROM_UNIXTIME(?/1000)) as loginHour, hour(FROM_UNIXTIME(min(timestamp)/1000)) as minLoginTime, hour(FROM_UNIXTIME(max(timestamp)/1000)) as maxLoginTime from OverallAuthTable where DAYOFWEEK(FROM_UNIXTIME(?/1000)) = DAYOFWEEK(FROM_UNIXTIME(timestamp/1000)) and (timestamp > UNIX_TIMESTAMP(subdate(current_date, 28))) and authStepSuccess = 1 and eventType=?;', loginTime, loginTime, 'overall', 'loginHour long, minLoginTime long, maxLoginTime long' )
select username, loginIp, loginHour, minLoginTime, maxLoginTime, messageId
insert into dayFilterStream;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment