Skip to content

add mysql compatible function bit_length#24531

Merged
jaystarshot merged 1 commit intoprestodb:masterfrom
shenh062326:add_bit_length
Feb 15, 2025
Merged

add mysql compatible function bit_length#24531
jaystarshot merged 1 commit intoprestodb:masterfrom
shenh062326:add_bit_length

Conversation

@shenh062326
Copy link
Contributor

@shenh062326 shenh062326 commented Feb 11, 2025

Description

Add a mysql compatible function bit_length, it returns the count of bits for the given string.

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* Add a MySQL-compatible function ``bit_length`` that returns the count of bits for the given string.


@shenh062326 shenh062326 requested a review from a team as a code owner February 11, 2025 10:52
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 11, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: shenh062326 / name: HongShen (4de2500)

@steveburnett
Copy link
Contributor

Thanks for the release note! A few minor changes suggested to follow the Release Notes Guidelines.

== RELEASE NOTES ==

General Changes
* Add a MySQL-compatible function ``bit_length`` that returns the count of bits for the given string.

@jaystarshot
Copy link
Member

Can you please add some documentation? (preferrably in https://prestodb.io/docs/current/functions/string.html)

@shenh062326
Copy link
Contributor Author

Can you please add some documentation? (preferrably in https://prestodb.io/docs/current/functions/string.html)

Done.

@shenh062326
Copy link
Contributor Author

Thanks for the release note! A few minor changes suggested to follow the Release Notes Guidelines.

== RELEASE NOTES ==

General Changes
* Add a MySQL-compatible function ``bit_length`` that returns the count of bits for the given string.

Done.

Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM! (docs)

Pull branch, new local doc build, looks good. Thanks!


@Description("count of bits for the given string")
@ScalarFunction("bit_length")
@LiteralParameters("x")
Copy link
Member

Choose a reason for hiding this comment

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

This literal parameter is not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here I refer to the implementation of the length function in StringFunctions.java.

@jaystarshot
Copy link
Member

I think you can squash both commits into the first one

@shenh062326
Copy link
Contributor Author

I think you can squash both commits into the first one

Done.

@jaystarshot jaystarshot merged commit 652026b into prestodb:master Feb 15, 2025
55 checks passed
@shenh062326 shenh062326 deleted the add_bit_length branch February 17, 2025 02:34
@prestodb-ci prestodb-ci mentioned this pull request Mar 28, 2025
30 tasks
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.

3 participants