-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add CAST TIMESTAMP WITH TIME ZONE to and from TIMESTAMP #6529
Conversation
✅ Deploy Preview for meta-velox canceled.
|
8e74401
to
f3928e6
Compare
eeb2454
to
679a83c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zacw7 Zac, please, update the documentation to include the new CAST logic: https://facebookincubator.github.io/velox/functions/presto/conversion.html
f7582a4
to
cf6dced
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
9d3eadf
to
07d05fb
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
07d05fb
to
18b789f
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zacw7 Thank you for adding detailed documentation. This is very helpful. Appreciate your effort.
Overall looks good % a few minor comments.
velox/functions/prestosql/tests/TimestampWithTimeZoneCastTest.cpp
Outdated
Show resolved
Hide resolved
velox/functions/prestosql/tests/TimestampWithTimeZoneCastTest.cpp
Outdated
Show resolved
Hide resolved
0aca69d
to
3b3f0e8
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zacw7 Thank you.
@laithsakka @kagamiori Laith, Wei, please, take a look as well.
SELECT cast(from_unixtime(0, '+06:00') as timestamp); -- 1970-01-01 06:00:00.000 | ||
SELECT cast(from_unixtime(0, '-02:00') as timestamp); -- 1969-12-31 22:00:00.000 | ||
|
||
Cast to Timestamp with Time Zone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIMESTAMP WITH TIME ZONE
|
||
auto timestampVector = rowResult.childAt(0)->asFlatVector<int64_t>(); | ||
auto timezoneVector = rowResult.childAt(1)->asFlatVector<int16_t>(); | ||
auto rawTsValues = timestampVector->values()->asMutable<int64_t>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zacw7 Please, double check.
3b3f0e8
to
997441a
Compare
This change adds casting support for timestamp with time zone. Currently, it only supports cast timestamp with time zone from and to timestamp. Presto also allows casting from/to Date and Varchar, which are not included in the current change.
997441a
to
0af11d9
Compare
@zacw7 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
…bator#6529) Summary: Presto also allows CAST TIMESTAMP WITH TIME ZONE to and from DATE and VARCHAR. This functionality is not available yet. Pull Request resolved: facebookincubator#6529 Reviewed By: mbasmanova Differential Revision: D49196796 Pulled By: zacw7 fbshipit-source-id: 57dff733fda2320c1f7ee2a09a35d8ea7823fa8f
…bator#6529) Summary: Presto also allows CAST TIMESTAMP WITH TIME ZONE to and from DATE and VARCHAR. This functionality is not available yet. Pull Request resolved: facebookincubator#6529 Reviewed By: mbasmanova Differential Revision: D49196796 Pulled By: zacw7 fbshipit-source-id: 57dff733fda2320c1f7ee2a09a35d8ea7823fa8f
…bator#6529) Summary: Presto also allows CAST TIMESTAMP WITH TIME ZONE to and from DATE and VARCHAR. This functionality is not available yet. Pull Request resolved: facebookincubator#6529 Reviewed By: mbasmanova Differential Revision: D49196796 Pulled By: zacw7 fbshipit-source-id: 57dff733fda2320c1f7ee2a09a35d8ea7823fa8f
…bator#6529) Summary: Presto also allows CAST TIMESTAMP WITH TIME ZONE to and from DATE and VARCHAR. This functionality is not available yet. Pull Request resolved: facebookincubator#6529 Reviewed By: mbasmanova Differential Revision: D49196796 Pulled By: zacw7 fbshipit-source-id: 57dff733fda2320c1f7ee2a09a35d8ea7823fa8f
Presto also allows CAST TIMESTAMP WITH TIME ZONE to and from DATE and VARCHAR.
This functionality is not available yet.