Finding number of users in each 15 minutes interval continuously for 6 years in hive - hive

I have more than 100k users. Each user starts using their phone at different timestamp value and ends by different timestamp.
I want to know for each 15 minutes interval how many users are using their phone
Attached the sample input and required output format.

Related

Deduping to newest items in a time bucket for time series

Some data gets logged every 10 hours for machines with an ID.
I want to do a timeplot with one point for every 24 hours.
How do I get the newest datapoint by ID for these 24 hour buckets?

Select Data between current time - 15 mins and current time in SQL

I am looking to pull data between two time periods at only 15 to 30 mins apart. I want to be able to rerun the code multiple times to constantly update the data I had already pulled. I know there is a function for current system time but I am unable to use it effectively in SQL developer.
I have tried using the function CURRENT_TIMESTAMP but could not get it to work effectively.
Currently i am using the following code and just pulling over a broad time frame, but i would like to shrink that down to 15 to 30 minute intervals that could be used to continue to pull updated data.
I expect to be able to pull current data within 15 to 30 minute segments of time.

Has Google just changed their historical stock price interface (again)?

For years I've been using webpage requests like the following to retrieve 20 days at a time of minutewise stock data from Google:
http://www.google.com/finance/getprices?q=.INX&i=60&p=20d&f=d,c,h,l,o,v
= Retrieve for .INX (S&P 500 index) 60-second interval data for the last 20 days, with format Datetime(in Unix format), Close, High, Low, Open, Volume.
The Datetime is in Unix format (seconds since 1/1/1970, prefixed with an "A") for the first entry of each day, and subsequent entries show the intervals that have passed (so 1 = 60 seconds after the opening of the market that day).
That worked up until 9/10/2017, but today (9/17) it only returns day-end data (it even reports the "interval" between samples as 86400). Pooey! I can get that anywhere, in bulk.
But if I ask for fewer days, or broader intervals, it seems to return data - but weird data. Asking for data every 120 seconds returns exactly that - but only for every other market day. Weird!
Has anyone got a clue what might have happened?
Whoa! I think I figured it out.
Google still returns minutewise data for the same approximate limitations (up to 20 calendar days), but instead of d=10 returning all the market data for the last 10 calendar days, it return the data for the last 10 market days. Previously, to get the last 10 market days you would ask for d=14 (M-Fx2, plus two weekends). Now, Google interprets the d variable as market days, and asking for d=20 exceeds the limits on what they will deliver.
It now appears that d=15 is the limit (three weeks of market days). No clue on why I got the very weird every-other-day data for a while... but maybe if you exceed their d-limits the intervals get screwy. Dunno. Don't care. Easy fix.

Bigquery - Table decorators changed weirdly

I used to have a number of queries running on the past 40 days of data using a decorator with [dataset.table#-4123456789-].
However, since September 15 all the decorators return maximum 10 days of data.
By the way [dataset.table#0] returns the whole table and not the past 7 days as told in the documentation.
Does anyone know what is going on. Do I have to move my table to partition in order to receive data for a limited period of time but more the a week?
Thanks

Find the user logged in to application how many times with different version

I have a Oracle table which has record of frequent logins with different versions of applications. for Version_1 there is one entry but for Version_2 there are 8 entries. These 8 entries are having different time stamps(different milli sec). I want to find out for each user howmany times he is logging in to the Version_2 application. Here we can take Minutes to remove duplicate records.
Here is the sample data with column names
I want to find out the each user has logged in how many time excluding the duplicate entry(these entries have different time stamps with change in milli seconds).
Try this query
SELECT count(emp_id) as log_number,app_version FROM YOUR_TABLE_NAME WHERE
app_version like 'VER_2';