Omega359 commented on code in PR #9388: URL: https://github.com/apache/arrow-datafusion/pull/9388#discussion_r1509292855
########## 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: It's unfortunately but this rustdoc won't work as is because of the SessionContext::new() call is into a non-accessible module. I think we either need to pull examples out of rustdoc or find some other solution that doesn't involve circular dependencies. This is one of the more limiting aspects with rust documentation I've encountered. -- 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]
