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

Support implicit type conversion from string to boolean #117

Closed

Conversation

dai-chen
Copy link
Collaborator

@dai-chen dai-chen commented Jun 9, 2021

Description

Changes

  1. Add missing cast function for byte and short: because after changes, cast function must exist for implicit conversion to the type.
  2. Support implicit conversion from string to bool by wrapping original function builder during compile time. In particular, if there is mismatch between unresolved (user given) and resolved function signature, wrap argument(s) of "mismatched" type by cast function. Please see user manual and design doc below for more details.

Documentation

  1. User manual: https://github.com/dai-chen/sql-1/blob/support-cast-bool-to-string/docs/user/general/datatypes.rst
  2. Design doc: https://github.com/dai-chen/sql-1/blob/support-cast-bool-to-string/docs/dev/TypeConversion.md

TODO: Remove special case for conversion between numbers and fix all failed UTs.

Issues Resolved

#113

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dai-chen dai-chen added enhancement New feature or request SQL labels Jun 9, 2021
@dai-chen dai-chen self-assigned this Jun 9, 2021
dai-chen added 11 commits June 9, 2021 13:40
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
Signed-off-by: Chen Dai <[email protected]>
@dai-chen dai-chen marked this pull request as ready for review June 16, 2021 18:01
@dai-chen dai-chen requested review from chloe-zh and penghuo June 16, 2021 18:01
@dai-chen dai-chen changed the title Support implicit type conversion between bool and string Support implicit type conversion from string to boolean Jun 16, 2021
@dai-chen dai-chen added the PPL Piped processing language label Jun 16, 2021
@davidcui1225 davidcui1225 deleted the branch opensearch-project:develop June 26, 2021 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PPL Piped processing language SQL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants