Omega359 commented on code in PR #19078:
URL: https://github.com/apache/datafusion/pull/19078#discussion_r2589270152
##########
datafusion/functions/src/datetime/common.rs:
##########
@@ -15,33 +15,52 @@
// specific language governing permissions and limitations
// under the License.
+use std::marker::PhantomData;
use std::sync::Arc;
+use arrow::array::timezone::Tz;
use arrow::array::{
Array, ArrowPrimitiveType, AsArray, GenericStringArray, PrimitiveArray,
StringArrayType, StringViewArray,
};
-use arrow::compute::kernels::cast_utils::string_to_timestamp_nanos;
-use arrow::datatypes::DataType;
+use arrow::compute::kernels::cast_utils::{
+ string_to_datetime, string_to_timestamp_nanos,
+};
+use arrow::datatypes::{DataType, TimeUnit};
+use arrow_buffer::ArrowNativeType;
use chrono::format::{parse, Parsed, StrftimeItems};
use chrono::LocalResult::Single;
use chrono::{DateTime, TimeZone, Utc};
-
use datafusion_common::cast::as_generic_string_array;
use datafusion_common::{
- exec_datafusion_err, exec_err, unwrap_or_internal_err, DataFusionError,
Result,
- ScalarType, ScalarValue,
+ exec_datafusion_err, exec_err, internal_datafusion_err,
unwrap_or_internal_err,
+ DataFusionError, Result, ScalarValue,
};
use datafusion_expr::ColumnarValue;
+use num_traits::{PrimInt, ToPrimitive};
/// 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";
+#[expect(unused)]
Review Comment:
Honestly I wasn't sure if it still could be used by a custom UDF that used
the same package name. I was just being super cautious since I hate breaking
other people's code needlessly.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]