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

executor: support firstrow under new aggregation evaluation framework #7057

Merged
merged 8 commits into from
Jul 18, 2018

Conversation

XuHuaiyu
Copy link
Contributor

What have you changed? (mandatory)

support first_row under new aggregation evaluation framework

What is the type of the changes? (mandatory)

  • Improvement (non-breaking change which is an improvement to an existing feature)

How has this PR been tested? (mandatory)

The existing test cases.

Does this PR affect documentation (docs/docs-cn) update? (mandatory)

no

Does this PR affect tidb-ansible update? (mandatory)

no

Does this PR need to be added to the release notes? (mandatory)

no

Refer to a related PR or issue link (optional)

#6952

Benchmark result if necessary (optional)

Add a few positive/negative examples (optional)

@XuHuaiyu XuHuaiyu added type/enhancement The issue or PR belongs to an enhancement. sig/execution SIG execution labels Jul 16, 2018
input, isNull, err := e.args[0].EvalInt(sctx, row)
if err != nil {
return errors.Trace(err)
}

This comment was marked as resolved.

p.isNull = true
break
}
p.val = input

This comment was marked as resolved.

@XuHuaiyu
Copy link
Contributor Author

PTAL @zz-jason @crazycs520

return nil
}

type firstRow4Uint struct {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this implementation? Can we directly use firstRow4Int?

break
}
// We should copy the input value here to avoid the origin value be covered.
p.val = fmt.Sprintf("%s", input)
Copy link
Member

Choose a reason for hiding this comment

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

this way is not efficient to copy a string, we should find another better way.

Copy link
Contributor

Choose a reason for hiding this comment

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

@zz-jason zz-jason added this to the 2.1 milestone Jul 16, 2018
package aggfuncs

import (
"fmt"
Copy link
Contributor

Choose a reason for hiding this comment

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

imported and not used: "fmt"

@jackysp
Copy link
Member

jackysp commented Jul 16, 2018

Please fix CI first.

@XuHuaiyu
Copy link
Contributor Author

/run-all-tests

@XuHuaiyu
Copy link
Contributor Author

/run-common-test tidb-test=pr/588
/run-integration-common-test tidb-test=pr/588

@XuHuaiyu
Copy link
Contributor Author

This PR should be merged with https://github.com/pingcap/tidb-test/pull/588 together

@XuHuaiyu
Copy link
Contributor Author

PTAL @zz-jason @crazycs520

return errors.Trace(err)
}
p.gotFirstRow = true
if isNull {
Copy link
Member

Choose a reason for hiding this comment

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

how about:

p.isNull = isNull
p.val = input
break

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 17, 2018
Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520 crazycs520 added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 17, 2018
@crazycs520
Copy link
Contributor

/run-all-tests

@winoros
Copy link
Member

winoros commented Jul 17, 2018

/run-common-test tidb-test=pr/588
/run-integration-common-test tidb-test=pr/588
/run-ddl-test

@winoros
Copy link
Member

winoros commented Jul 17, 2018

Merge if it's ready @XuHuaiyu

@zz-jason
Copy link
Member

/run-all-tests

@XuHuaiyu
Copy link
Contributor Author

/run-common-test tidb-test=pr/588
/run-integration-common-test tidb-test=pr/588

@XuHuaiyu XuHuaiyu merged commit 6b13c43 into pingcap:master Jul 18, 2018
@XuHuaiyu XuHuaiyu deleted the first_row branch July 18, 2018 01:37
@@ -36,6 +36,7 @@ var (

// All the AggFunc implementations for "SUM" are listed here.
// All the AggFunc implementations for "FIRSTROW" are listed here.

Copy link
Member

Choose a reason for hiding this comment

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

we should put all the implementations for first_row in this code block 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants