Skip to content
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 DATE TO DATE and TIMESTAMP TO DATE casting functions. #3220

Merged
merged 9 commits into from
Apr 8, 2024

Conversation

mxwli
Copy link
Contributor

@mxwli mxwli commented Apr 5, 2024

Closes #3218

DATE TO DATE casting is called when casting nested datatypes, eg LISTS and STRUCTS, and so registering it is necessary. See the linked issue for an example.

TIMESTAMP to DATE casting uses Timestamp::getDate.

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 96.42857% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 92.28%. Comparing base (d946982) to head (06f4fb8).
Report is 7 commits behind head on master.

❗ Current head 06f4fb8 differs from pull request most recent head 299f869. Consider uploading reports for the commit 299f869 to get more accurate results

Files Patch % Lines
src/function/vector_cast_functions.cpp 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3220      +/-   ##
==========================================
- Coverage   92.28%   92.28%   -0.01%     
==========================================
  Files        1161     1161              
  Lines       44150    43926     -224     
==========================================
- Hits        40744    40536     -208     
+ Misses       3406     3390      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mxwli
Copy link
Contributor Author

mxwli commented Apr 5, 2024

note: in copying the ValueVector in resolving nested types, an assert for resultVector.state.selVector.isUnfiltered is not made. This is in line with CastChildFunctionExecutor::executeSwitch, which is the function that would have run previously.

src/function/vector_cast_functions.cpp Show resolved Hide resolved
test/test_files/common/todatecast.test Show resolved Hide resolved
src/function/vector_cast_functions.cpp Show resolved Hide resolved
@mxwli mxwli merged commit 3e626f3 into master Apr 8, 2024
@mxwli mxwli deleted the todatecasting branch April 8, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsupported Casting function from DATE to DATE and TIMESTAMP to DATE
2 participants