-
Notifications
You must be signed in to change notification settings - Fork 70
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
Extend data types support for UTC dates, i.e. Timestamp
Athena type
#49
Comments
I somehow missed responding to this. If you wanna go ahead and add that, I'll be happy to take a look. Just consider any edge cases that might break it. |
Actually the more I think about this, the more it can cause more confusion for users since there are several date formats to convert into:
How would AthenaExpress know which format the user cares about? And the bigger question is, should this be something AthenaExpress does or should this functionality be handed over to the user to decide. |
Thank you for your reply.
Is the right question to ask. Unfortunately, |
ok i understand. Let me check on the effort required for this |
I would be happy to contribute the patch Thank you. |
Sure, please do. I'd be happy to look at it. |
Apologies for the delay on this. I expect to have a pull request ready in the next two weeks |
Hi team,
I'd like to extend data types support for UTC dates, i.e.
Timestamp
Athena type. My proposal is to create a new option, e.g.useUtcDates
, to cast values of columns with typeTimestamp
toDate
Javascript objects. This setting would have a default value offalse
. The caveat of this setting is that it will use machine-local time, thus this setting is intended for systems configured in UTC. This could be extended toDate
Type but it would transform dates into date and times, e.g. '2020-11-18' would become '2020-11-18T00:00:00Z'. I intentionally avoid castingtimestamp with time zone
Athena type to reduce complexity.For applications that deal with dates, converting
Timestamp
columns toDate
objects is a common task given that many libraries expectDate
objects. Moreover, athena-express hides the type in the result set. This forces developers that wish to operate using dates to access the column by name and explicitly convert values toDate
objects.I'd be willing to submit a patch if this feature request is approved.
Proposed update to documentation:
Timestamp
types to JavascriptDate
objects with times in UTC. Set this option if your code runs in machines configured with UTC as their timezone. Useful when yourTimestamp
columns are representing UTC date and time and you want to work withDate
objects instead ofString
objectsThe text was updated successfully, but these errors were encountered: