You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "rluvaton (via GitHub)" <gi...@apache.org> on 2025/12/09 12:28:57 UTC

Re: [PR] fix: derive nullability for spark `bit_get` [datafusion]

rluvaton commented on code in PR #19220:
URL: https://github.com/apache/datafusion/pull/19220#discussion_r2602435986


##########
datafusion/spark/src/function/bitwise/bit_get.rs:
##########
@@ -83,7 +83,13 @@ impl ScalarUDFImpl for SparkBitGet {
     }
 
     fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
-        Ok(DataType::Int8)
+        internal_err!("return_field_from_args should be used instead")
+    }
+
+    fn return_field_from_args(&self, args: ReturnFieldArgs) -> Result<FieldRef> {
+        // Spark marks bit_get as null-intolerant: result is nullable only if an input can be null

Review Comment:
   It is not that it is because of null-intolerant but because nullable is derived from the children



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org