Skip to content

[Feature Request]: Aggregation function bit_and() #1993

Closed

Description

@dengn

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

Describe the feature you'd like

  1. Similar to MySQL 8.0 in syntax.
  2. Function syntax

BIT_AND(expr)

Returns the bitwise AND of all bits in expr.

Both input parameters and output values are of type uint.

mysql> SELECT  MAKER, BIT_AND(PRICE) AS BITS
          FROM CARS GROUP BY MAKER
+---------------------------------------------------------+
|MAKER           BITS                                     |
+---------------------------------------------------------+
|CHRYSLER        512                                      |
|FORD            12488                                    |
|HONDA           2144                                     |
+---------------------------------------------------------+

Describe implementation you've considered

Documentation, Adoption, Use Case, Migration Strategy

  • Please refer to the tutorial about how to develop an aggregate function.

  • Please specify your factorization formula as well as the performance result with the dataset in our tutorial.

Additional information

Activity

  1. noneback commented on Mar 28, 2022

    @noneback
    Contributor

    Plz assign it to me. I will try my best in my spare time.

  2. dengn commented on Mar 28, 2022

    @dengn
    ContributorAuthor

    Plz assign it to me. I will try my best in my spare time.

    OK. Issue assigned.

  3. noneback commented on Mar 31, 2022

    @noneback
    Contributor

    Do we need to support bit_and(str)? I have noticed that like SUM agg function in original matrixone repository does not support string type as a parameter. So I prefer to not using string as an input in order to simplify my code.

  4. noneback commented on Mar 31, 2022

    @noneback
    Contributor

    I just find the description Both input parameters and output values are of type uint., but currently, I have supported all numeric types already, cuz MySQL bit_and(expr) support all numeric type as an input. Do I need to change it back?

  5. noneback commented on Apr 1, 2022

    @noneback
    Contributor

    I have finished this issue in #2092

  6. dengn commented on Apr 2, 2022

    @dengn
    ContributorAuthor

    Feature implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issuelevel/challenging

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions