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

Add toYYYYMMDDhhmmss function #1767

Merged

Conversation

ygf11
Copy link
Contributor

@ygf11 ygf11 commented Sep 8, 2021

I hereby agree to the terms of the CLA available at: https://datafuse.rs/policies/cla/

Summary

  1. add toYYYYMMDDhhmmss and toYYYYMMDD function .
  2. add doc.

Changelog

  • New Feature

Related Issues

Fixes #issue

Test Plan

Unit Tests

Stateless Tests

@databend-bot databend-bot added the pr-feature this PR introduces a new feature to the codebase label Sep 8, 2021
@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@codecov-commenter
Copy link

codecov-commenter commented Sep 8, 2021

Codecov Report

Merging #1767 (ec2dab5) into master (6b7f439) will increase coverage by 0%.
The diff coverage is 94%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #1767    +/-   ##
=======================================
  Coverage      72%     72%            
=======================================
  Files         610     610            
  Lines       36212   36452   +240     
=======================================
+ Hits        26130   26361   +231     
- Misses      10082   10091     +9     
Impacted Files Coverage Δ
...mon/functions/src/scalars/dates/number_function.rs 69% <69%> (-4%) ⬇️
common/functions/src/scalars/dates/date.rs 54% <100%> (+4%) ⬆️
.../functions/src/scalars/dates/date_function_test.rs 99% <100%> (+<1%) ⬆️
...pelines/transforms/transform_aggregator_partial.rs 89% <0%> (-2%) ⬇️
query/src/common/mod.rs 87% <0%> (-2%) ⬇️
store/src/meta_service/meta_service_impl.rs 75% <0%> (-2%) ⬇️
store/src/meta_service/raftmeta.rs 93% <0%> (+1%) ⬆️
store/src/meta_service/network.rs 74% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b7f439...ec2dab5. Read the comment docs.

@BohuTANG
Copy link
Member

BohuTANG commented Sep 8, 2021

/review @sundy-li

@databend-bot
Copy link
Member

Take the reviewer to sundy-li

@BohuTANG
Copy link
Member

BohuTANG commented Sep 8, 2021

/help

@databend-bot
Copy link
Member

/assignme -- assign the issue to you
/review @[username] -- take a reviewer for you
/help -- show help

@sundy-li
Copy link
Member

sundy-li commented Sep 8, 2021

LGTM, let's add toYYYYMMDD into this pr?

@ygf11
Copy link
Contributor Author

ygf11 commented Sep 9, 2021

LGTM, let's add toYYYYMMDD into this pr?

Yeah, that's ok.

impl<T, R> Function for NumberFunction<T, R>
where
T: NumberResultFunction<R> + Clone + Sync + Send + 'static,
R: DFPrimitiveType + Clone + Sync + Send + 'static,
Copy link
Member

Choose a reason for hiding this comment

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

DFPrimitiveType: NativeType

NativeType is already Sync + Send + 'static

let constant_result = Some(T::execute(date_time));
Ok(DataColumn::Constant(DataValue::UInt32(constant_result), input_rows))
let constant_result = T::to_constant_value(date_time);
Ok(DataColumn::Constant(constant_result, input_rows))
}else {
Copy link
Member

Choose a reason for hiding this comment

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

} else {

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, why cargo CI can't warning this?

@ygf11 ygf11 force-pushed the feat_toYYYYMMDDhhmmss_function branch from 0930c10 to ec2dab5 Compare September 9, 2021 14:13
Copy link
Member

@sundy-li sundy-li left a comment

Choose a reason for hiding this comment

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

Looks great to me.

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot databend-bot merged commit e1157d4 into databendlabs:master Sep 9, 2021
@ygf11 ygf11 deleted the feat_toYYYYMMDDhhmmss_function branch April 30, 2022 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-take pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants