Omega359 commented on code in PR #9388:
URL: https://github.com/apache/arrow-datafusion/pull/9388#discussion_r1506734138


##########
datafusion/functions/src/datetime/to_timestamp.rs:
##########
@@ -0,0 +1,1184 @@
+// 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.
+
+use std::any::Any;
+use std::sync::Arc;
+
+use arrow::array::{
+    Array, ArrowPrimitiveType, GenericStringArray, OffsetSizeTrait, 
PrimitiveArray,
+};
+use arrow::compute::kernels::cast_utils::string_to_timestamp_nanos;
+use arrow::datatypes::DataType::Timestamp;
+use arrow::datatypes::TimeUnit::{Microsecond, Millisecond, Nanosecond, Second};
+use arrow::datatypes::{
+    ArrowTimestampType, DataType, TimestampMicrosecondType, 
TimestampMillisecondType,
+    TimestampNanosecondType, TimestampSecondType,
+};
+use chrono::prelude::*;
+use chrono::LocalResult::Single;
+use itertools::Either;
+
+use datafusion_common::cast::as_generic_string_array;
+use datafusion_common::{exec_err, DataFusionError, Result, ScalarType, 
ScalarValue};
+use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility};
+use datafusion_physical_expr::expressions::cast_column;
+
+/// Error message if nanosecond conversion request beyond supported interval
+const ERR_NANOSECONDS_NOT_SUPPORTED: &str = "The dates that can be represented 
as nanoseconds have to be between 1677-09-21T00:12:44.0 and 
2262-04-11T23:47:16.854775804";
+
+#[derive(Debug)]
+pub(super) struct ToTimestampFunc {

Review Comment:
   Ok. I just looked into it and it's actually more than the impl methods 
because it would affect the make_udf_function macro as well (or a clone) to 
allow args to be passed into the ::new() call. Possible for a future improvement



-- 
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]

Reply via email to