Skip to content

Conversation

@mczhuang
Copy link
Contributor

@mczhuang mczhuang commented Mar 7, 2022

What's changed and what's your intention?

As title

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Summarize your change (mandatory)
  • How does this PR work? Need a brief introduction for the changed logic (optional)
  • Describe clearly one logical change and avoid lazy messages (optional)
  • Describe any limitations of the current code (optional)

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

#724 #847

@mczhuang mczhuang requested a review from neverchanje March 7, 2022 12:18
@github-actions github-actions bot added the type/feature Type: New feature. label Mar 7, 2022
@neverchanje
Copy link
Contributor

This work is not that simple, you also need to check the validity of the arguments.

postgres=# select length(1);
ERROR:  function length(integer) does not exist
LINE 1: select length(1);
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

postgres=# select length('abc');
 length
--------
      3
(1 row)

It doesn't work unless the argument is a single-quoted string.

So, add those function signatures in rust/frontend/src/expr/type_inference.rs, and include some tests.

@neverchanje neverchanje marked this pull request as draft March 7, 2022 12:31
@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #734 (93665e9) into main (cd1a769) will increase coverage by 0.05%.
The diff coverage is 94.61%.

@@             Coverage Diff              @@
##               main     #734      +/-   ##
============================================
+ Coverage     71.71%   71.76%   +0.05%     
  Complexity     2766     2766              
============================================
  Files           996      996              
  Lines         83869    84016     +147     
  Branches       1790     1790              
============================================
+ Hits          60145    60293     +148     
+ Misses        22833    22832       -1     
  Partials        891      891              
Flag Coverage Δ
java 61.01% <ø> (ø)
rust 74.26% <94.61%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rust/frontend/src/binder/expr/binary_op.rs 84.84% <0.00%> (-2.66%) ⬇️
rust/sqlparser/src/ast/mod.rs 86.51% <0.00%> (-0.44%) ⬇️
rust/sqlparser/src/parser.rs 92.77% <90.00%> (+0.02%) ⬆️
rust/frontend/src/binder/expr/mod.rs 78.19% <91.30%> (+14.13%) ⬆️
rust/frontend/src/binder/expr/function.rs 84.50% <100.00%> (+4.50%) ⬆️
rust/frontend/src/binder/values.rs 87.32% <100.00%> (ø)
rust/frontend/src/expr/type_inference.rs 91.58% <100.00%> (+5.55%) ⬆️
rust/common/src/types/ordered_float.rs 22.50% <0.00%> (+0.19%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest lgtm, fix the ci errors.

@mczhuang
Copy link
Contributor Author

mczhuang commented Mar 11, 2022

Added Case support, please re review

@neverchanje neverchanje marked this pull request as ready for review March 12, 2022 02:13
@neverchanje neverchanje requested a review from xiangjinwu March 12, 2022 02:13
@neverchanje neverchanje linked an issue Mar 12, 2022 that may be closed by this pull request
30 tasks
@mczhuang
Copy link
Contributor Author

mczhuang commented Mar 15, 2022

I will add tests in later PR for complex conflicts caused by basic_query.yaml.

Copy link
Contributor

@xiangjinwu xiangjinwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest lgtm

@mczhuang mczhuang merged commit e4edd71 into main Mar 18, 2022
@mczhuang mczhuang deleted the mczhuang/bind_func branch March 18, 2022 09:23
@mczhuang mczhuang mentioned this pull request Mar 21, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature Type: New feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend(binder): Bind builtin functions.

5 participants