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

Issue 2269 #2281

Merged
merged 1 commit into from
Oct 30, 2023
Merged

Issue 2269 #2281

merged 1 commit into from
Oct 30, 2023

Conversation

andyfengHKU
Copy link
Contributor

@andyfengHKU andyfengHKU commented Oct 27, 2023

Fix issue #2269

As suggested by @OTooleMichael, when data type can not be resolved for parameters, using STRING as default type is preferable over INT64 because STRING is the most permissible type and can be casted to any other types.

This PR applies this change from two aspects

  • For primitive functions, when overloading is available, select STRING input over other inputs. E.g. to_int64($1) will expect $1 to have type STRING.
  • For nested functions, if child type is not available, use STRING as default. E.g. [$1] will have type STRING[].

Note

We might still miss default case for some functions. I hope to solve this with fuzzy testing rather than checking each function manually. Meanwhile, since the default input of casting functions has been changed to STRING. User can always use to_x($1) to get the expected type from STRING input. I think this is good enough for now.

src/binder/expression_binder.cpp Show resolved Hide resolved
src/common/types/types.cpp Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (627b5f5) 89.67% compared to head (d4772e1) 89.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2281      +/-   ##
==========================================
+ Coverage   89.67%   89.69%   +0.01%     
==========================================
  Files        1023     1023              
  Lines       35449    35456       +7     
==========================================
+ Hits        31788    31801      +13     
+ Misses       3661     3655       -6     
Files Coverage Δ
src/common/types/types.cpp 0.00% <ø> (ø)
src/function/built_in_functions.cpp 100.00% <ø> (ø)
src/function/vector_list_functions.cpp 93.10% <100.00%> (+0.02%) ⬆️
src/function/vector_struct_functions.cpp 94.64% <100.00%> (ø)
src/function/vector_union_functions.cpp 92.30% <100.00%> (+0.64%) ⬆️
src/include/binder/expression_binder.h 100.00% <ø> (ø)
src/include/common/types/types.h 100.00% <ø> (ø)
src/binder/expression_binder.cpp 95.12% <86.66%> (-2.38%) ⬇️

... and 1 file with indirect coverage changes

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

@andyfengHKU andyfengHKU merged commit 9b569a4 into master Oct 30, 2023
12 checks passed
@andyfengHKU andyfengHKU deleted the issue-2269 branch October 30, 2023 06:16
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.

None yet

2 participants