File tree Expand file tree Collapse file tree
datafusion/spark/src/function/math Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ fn spark_negative(args: &[ColumnarValue]) -> Result<ColumnarValue> {
9393 | DataType :: UInt8
9494 | DataType :: UInt16
9595 | DataType :: UInt32
96- | DataType :: UInt64 => Ok ( args [ 0 ] . clone ( ) ) ,
96+ | DataType :: UInt64 => Ok ( arg . clone ( ) ) ,
9797
9898 // Signed integers - use wrapping negation (Spark legacy mode behavior)
9999 DataType :: Int8 => {
@@ -190,8 +190,12 @@ fn spark_negative(args: &[ColumnarValue]) -> Result<ColumnarValue> {
190190 dt => not_impl_err ! ( "Not supported datatype for Spark negative(): {dt}" ) ,
191191 } ,
192192 ColumnarValue :: Scalar ( sv) => match sv {
193- ScalarValue :: Null => Ok ( args[ 0 ] . clone ( ) ) ,
194- sv if sv. is_null ( ) => Ok ( args[ 0 ] . clone ( ) ) ,
193+ ScalarValue :: Null
194+ | ScalarValue :: UInt8 ( _)
195+ | ScalarValue :: UInt16 ( _)
196+ | ScalarValue :: UInt32 ( _)
197+ | ScalarValue :: UInt64 ( _) => Ok ( arg. clone ( ) ) ,
198+ sv if sv. is_null ( ) => Ok ( arg. clone ( ) ) ,
195199
196200 // Signed integers - wrapping negation
197201 ScalarValue :: Int8 ( Some ( v) ) => {
You can’t perform that action at this time.
0 commit comments