-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time.Time column type #40
Comments
As a starting point, I was thinking one might create a /tcolumn package that had roughly the equivalent of: |
Hi! I'm very much open to adding a time type to qframe if you see use for it. There have been discussions/suggestions for such a type before. Would it be possible to list a couple of use cases for such a type where it makes usage easier (or more intuitive) compared to an int for example. Just to know what the priorities are and what we're aiming for. The entrypoints you list above are good starting points/templates for adding a new type. You'd probably need to add some basic functions for serialization to/from strings/ints as well. I'd be happy to help out with any questions and PR reviewing if you want to contribute a new time type! |
Thanks! Here are some examples for talking points:
And possible implementations for isUnixDayOfTheWeek:
In this scenario, my main concerns were the complexity of making filters time zone aware, and possible performance hit from doing conversion vs:
However, after doing some benchmarking (in this case a filter testing if hour of the day is between noon and 2PM - see gist for implementation):
it seems that filtering half a million timestamps isn't very time consuming regardless of if you convert from an int first Another use case would be to drive logic off of column type:
vs
Adopting a naming convention where I prefix my date column names with "time_" seems like a reasonable work around. Being able to pull in time.Time directly from sql would also be helpful. |
Great investigation! I guess what Being able to read time directly from SQL is a nice use case! One point worth noting about One could of course come up with other, more space, and GC efficient, internal representations and then convert it on the fly to |
Hello! I have a use case where I'd like to sort/filter/group based on time. While in practice, I could likely use an int/string column to represent my time and convert it (if necessary) within an operation to time.Time - I'm not inclined to think this will perform as well as a solution which stores the time internally.
Curious if you would:
Thanks in advance!
The text was updated successfully, but these errors were encountered: