Copilot commented on code in PR #2409:
URL: https://github.com/apache/auron/pull/2409#discussion_r3619534336


##########
native-engine/datafusion-ext-functions/src/lib.rs:
##########
@@ -97,6 +98,7 @@ pub fn create_auron_ext_function(
             
Arc::new(spark_normalize_nan_and_zero::spark_normalize_nan_and_zero)
         }
         "Spark_IsNaN" => Arc::new(spark_isnan::spark_isnan),
+        "Flink_UnixTimestamp" => 
Arc::new(flink_datetime::flink_unix_timestamp),
         _ => df_unimplemented_err!("spark ext function not implemented: 
{name}")?,

Review Comment:
   The default error message says "spark ext function not implemented" even 
though this registry now includes Flink (and potentially other engines). This 
makes diagnostics misleading when a non-Spark function name is 
missing/misspelled.



##########
native-engine/datafusion-ext-functions/src/flink_datetime.rs:
##########
@@ -0,0 +1,637 @@
+// 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::sync::Arc;
+
+use arrow::{
+    array::{Int64Array, StringArray},
+    datatypes::DataType,
+};
+use chrono::{DateTime, LocalResult, NaiveDateTime, Offset, TimeZone};
+use chrono_tz::{OffsetComponents, Tz};
+use datafusion::{
+    common::{DataFusionError, Result, ScalarValue},
+    physical_plan::ColumnarValue,
+};
+use datafusion_ext_commons::arrow::cast::cast;
+
+/// Flink `UNIX_TIMESTAMP(value, format)`: parse a formatted date-time string 
to
+/// a Unix timestamp in seconds, replicating `java.text.SimpleDateFormat`
+/// lenient semantics.

Review Comment:
   The doc comment signature mentions `UNIX_TIMESTAMP(value, format)`, but this 
native function’s contract is arity-3 (`[value, chronoFormat, zoneId]`). 
Aligning the signature in the comment avoids confusion for future maintainers.



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