Skip to content

[enhancement](Nereids)support count, min and avg function#11374

Merged
924060929 merged 4 commits intoapache:masterfrom
yinzhijian:dev.nereids_count
Aug 4, 2022
Merged

[enhancement](Nereids)support count, min and avg function#11374
924060929 merged 4 commits intoapache:masterfrom
yinzhijian:dev.nereids_count

Conversation

@yinzhijian
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

Problem Summary:

  1. add count function
  2. add min function
  3. add avg function

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes
    • No

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions github-actions bot added area/nereids area/planner Issues or PRs related to the query planner labels Jul 31, 2022
jackwener
jackwener previously approved these changes Aug 1, 2022
Copy link
Member

@jackwener jackwener left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2022

PR approved by anyone and no changes requested.

@924060929
Copy link
Contributor

924060929 commented Aug 1, 2022

good job, could you add some regression test suite in regression-test/suites/ssb_sf1/nereids/ like this?

suite('test_nereids_aggregate_function') {
    // use regression_test_ssb_sf1 database, compute ssb database by suite directory
    String realDb = context.config.getDbNameByFile(context.file)
    // get parent directory's group
    realDb = realDb.substring(0, realDb.lastIndexOf("_"))

    sql "use ${realDb}"

    sql 'set enable_nereids_planner=true'
    // nereids need vectorized
    sql 'set enable_vectorized_engine=true'

    qt 'select count(*), count(l.*), count(1), count(lo_orderkey), count(l.lo_orderkey), min(lo_revenue), min(l.lo_revenue), avg(lo_revenue), avg(l.lo_revenue) from lineorder as l'
}

@yinzhijian yinzhijian force-pushed the dev.nereids_count branch 2 times, most recently from fe07048 to 62513e1 Compare August 2, 2022 13:09

public Count() {
super("count");
this.isStar = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to handle count(1) and count(*) in PruneAggChildColumns.

@morrySnow morrySnow removed reviewed area/planner Issues or PRs related to the query planner kind/test labels Aug 3, 2022
Copy link
Contributor

@924060929 924060929 left a comment

Choose a reason for hiding this comment

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

LGTM

@924060929 924060929 merged commit 6dc41d5 into apache:master Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants