alamb commented on code in PR #9388: URL: https://github.com/apache/arrow-datafusion/pull/9388#discussion_r1509314219
########## datafusion/functions/src/datetime/mod.rs: ########## @@ -0,0 +1,144 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//! date & time DataFusion functions + +use std::sync::Arc; + +use datafusion_expr::ScalarUDF; + +mod common; +mod to_date; +mod to_timestamp; + +// create UDFs +make_udf_function!(to_date::ToDateFunc, TO_DATE, to_date); +make_udf_function!(to_timestamp::ToTimestampFunc, TO_TIMESTAMP, to_timestamp); +make_udf_function!( + to_timestamp::ToTimestampSecondsFunc, + TO_TIMESTAMP_SECONDS, + to_timestamp_seconds +); +make_udf_function!( + to_timestamp::ToTimestampMillisFunc, + TO_TIMESTAMP_MILLIS, + to_timestamp_millis +); +make_udf_function!( + to_timestamp::ToTimestampMicrosFunc, + TO_TIMESTAMP_MICROS, + to_timestamp_micros +); +make_udf_function!( + to_timestamp::ToTimestampNanosFunc, + TO_TIMESTAMP_NANOS, + to_timestamp_nanos +); + +// we cannot currently use the export_functions macro since it doesn't handle +// functions with varargs currently + +pub mod expr_fn { + use datafusion_expr::Expr; + + /// ```ignore Review Comment: I agree we probably need to pull them out of the rust doc directly (maybe we can put them in the examples 🤔 ) and maybe link to them ########## datafusion/functions/src/datetime/mod.rs: ########## @@ -0,0 +1,144 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +//! date & time DataFusion functions + +use std::sync::Arc; + +use datafusion_expr::ScalarUDF; + +mod common; +mod to_date; +mod to_timestamp; + +// create UDFs +make_udf_function!(to_date::ToDateFunc, TO_DATE, to_date); +make_udf_function!(to_timestamp::ToTimestampFunc, TO_TIMESTAMP, to_timestamp); +make_udf_function!( + to_timestamp::ToTimestampSecondsFunc, + TO_TIMESTAMP_SECONDS, + to_timestamp_seconds +); +make_udf_function!( + to_timestamp::ToTimestampMillisFunc, + TO_TIMESTAMP_MILLIS, + to_timestamp_millis +); +make_udf_function!( + to_timestamp::ToTimestampMicrosFunc, + TO_TIMESTAMP_MICROS, + to_timestamp_micros +); +make_udf_function!( + to_timestamp::ToTimestampNanosFunc, + TO_TIMESTAMP_NANOS, + to_timestamp_nanos +); + +// we cannot currently use the export_functions macro since it doesn't handle +// functions with varargs currently + +pub mod expr_fn { + use datafusion_expr::Expr; + + /// ```ignore Review Comment: I agree we probably need to pull them out of the rust doc directly (maybe we can put them in the examples 🤔 ) and maybe link to them from here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
