Copilot commented on code in PR #3278:
URL: https://github.com/apache/datafusion-comet/pull/3278#discussion_r2726359620


##########
native/spark-expr/src/datetime_funcs/date_diff.rs:
##########
@@ -97,8 +111,4 @@ impl ScalarUDFImpl for SparkDateDiff {
 
         Ok(ColumnarValue::Array(Arc::new(result)))
     }
-
-    fn aliases(&self) -> &[String] {
-        &self.aliases
-    }
 }

Review Comment:
   The `aliases` field still includes `"datediff"`, but the `fn aliases(&self) 
-> &[String]` implementation was removed. If `ScalarUDFImpl`'s default 
`aliases()` returns an empty slice (as used by other UDF impls in this crate), 
this will drop the `datediff` alias and can break Spark SQL/function resolution 
that relies on the alias rather than the primary name `date_diff`. Re-introduce 
`aliases()` (returning `&self.aliases`) or remove `aliases` entirely and ensure 
the UDF is registered under the intended name(s).



##########
native/spark-expr/src/datetime_funcs/date_diff.rs:
##########
@@ -16,6 +16,7 @@
 // under the License.
 
 use arrow::array::{Array, Date32Array, Int32Array};
+use arrow::compute::cast;

Review Comment:
   `use arrow::compute::cast;` is unused (the code calls 
`arrow::compute::cast(...)` with a fully-qualified path). This will fail CI 
because clippy is run with `-D warnings`. Either remove this import or use 
`cast(&end_arr, &DataType::Date32)` / `cast(&start_arr, &DataType::Date32)` so 
the import is actually used.
   ```suggestion
   
   ```



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

Reply via email to