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

expression: rewrite builtin function: WEEKDAY, FROM_DAYS, QURTER #4298

Merged
merged 3 commits into from Aug 24, 2017

Conversation

Projects
None yet
3 participants
@zz-jason
Member

zz-jason commented Aug 23, 2017

to #4080

@zz-jason zz-jason referenced this pull request Aug 23, 2017

Closed

rewrite builtin functions #4080

150 of 150 tasks complete
@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason
Member

zz-jason commented Aug 23, 2017

@breeswish

This comment has been minimized.

Show comment
Hide comment
@breeswish

breeswish Aug 23, 2017

Member

LGTM

Member

breeswish commented Aug 23, 2017

LGTM

n, isNull, err := b.args[0].EvalInt(row, sc)
if isNull || err != nil {
return types.Time{}, true, errors.Trace(err)

This comment has been minimized.

@winkyao

winkyao Aug 23, 2017

Member

return types.Time{}, isNull, errors.Trace(err)?

@winkyao

winkyao Aug 23, 2017

Member

return types.Time{}, isNull, errors.Trace(err)?

This comment has been minimized.

@zz-jason

zz-jason Aug 23, 2017

Member

when err is not nil, we should return a NULL value if the upper layers decide to ignore this error, because in this case the returned value, which is types.Time{} here, is undefined and should not be used.

@zz-jason

zz-jason Aug 23, 2017

Member

when err is not nil, we should return a NULL value if the upper layers decide to ignore this error, because in this case the returned value, which is types.Time{} here, is undefined and should not be used.

date, isNull, err := b.args[0].EvalTime(row, sc)
if isNull || err != nil {
return 0, true, errors.Trace(handleInvalidTimeError(b.ctx, err))

This comment has been minimized.

@winkyao

winkyao Aug 23, 2017

Member

ditto.

@winkyao

winkyao Aug 23, 2017

Member

ditto.

This comment has been minimized.

@zz-jason

zz-jason Aug 23, 2017

Member

we should return a NULL if the err is a invalid time error and ignored in handleInvalidTimeError

@zz-jason

zz-jason Aug 23, 2017

Member

we should return a NULL if the err is a invalid time error and ignored in handleInvalidTimeError

return d, errors.Trace(err)
date, isNull, err := b.args[0].EvalTime(row, sc)
if isNull || err != nil {
return 0, true, errors.Trace(handleInvalidTimeError(b.ctx, err))

This comment has been minimized.

@winkyao

winkyao Aug 23, 2017

Member

ditto.

@winkyao

winkyao Aug 23, 2017

Member

ditto.

@winkyao

Reset LGTM

@zz-jason zz-jason merged commit b406778 into master Aug 24, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@zz-jason zz-jason deleted the timefunc_weekday branch Aug 24, 2017

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