shifluxxc commented on code in PR #19224:
URL: https://github.com/apache/datafusion/pull/19224#discussion_r2610521689
##########
datafusion/spark/src/function/bitwise/bitwise_not.rs:
##########
@@ -64,8 +66,21 @@ impl ScalarUDFImpl for SparkBitwiseNot {
&self.signature
}
- fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
- Ok(arg_types[0].clone())
+ fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
+ internal_err!("SparkBitwiseNot: return_type() is not used;
return_field_from_args() is implemented")
+ }
+
+ fn return_field_from_args(&self, args: ReturnFieldArgs) ->
Result<FieldRef> {
+ if args.arg_fields.len() != 1 {
+ return plan_err!("bitwise_not expects exactly 1 argument");
+ }
+
+ let input_field = &args.arg_fields[0];
+
+ let out_dt = input_field.data_type().clone();
+ let out_nullable = input_field.is_nullable();
Review Comment:
I have added the test case and made the change as instructed , please review
@martin-g .
--
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]