Re: [PR] Fix `NULL["field"]` for expr_API [datafusion]

2024-05-25 Thread via GitHub


alamb commented on PR #10655:
URL: https://github.com/apache/datafusion/pull/10655#issuecomment-2131186851

   Thank you for the speedy review @jayzhan211 


-- 
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-unsubscr...@datafusion.apache.org

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


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



Re: [PR] Fix `NULL["field"]` for expr_API [datafusion]

2024-05-25 Thread via GitHub


alamb merged PR #10655:
URL: https://github.com/apache/datafusion/pull/10655


-- 
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-unsubscr...@datafusion.apache.org

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


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



Re: [PR] Fix `NULL["field"]` for expr_API [datafusion]

2024-05-25 Thread via GitHub


alamb commented on code in PR #10655:
URL: https://github.com/apache/datafusion/pull/10655#discussion_r1614536504


##
datafusion/functions/src/core/getfield.rs:
##
@@ -106,6 +106,9 @@ impl ScalarUDFImpl for GetFieldFunc {
 };
 let access_schema = GetFieldAccessSchema::NamedStructField { name: 
name.clone() };
 let arg_dt = args[0].get_type(schema)?;
+if arg_dt.is_null() {
+return Ok(DataType::Null);
+}
 access_schema

Review Comment:
   Thanks @jayzhan211  
   
   I agree the change in 
https://github.com/apache/datafusion/commit/6cb45b5a9f2b53688a9754b1a7d06665ebd73a6d
 to inline things looks nice -- shall we make another PR?



-- 
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-unsubscr...@datafusion.apache.org

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


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



Re: [PR] Fix `NULL["field"]` for expr_API [datafusion]

2024-05-24 Thread via GitHub


jayzhan211 commented on code in PR #10655:
URL: https://github.com/apache/datafusion/pull/10655#discussion_r1614200131


##
datafusion/functions/src/core/getfield.rs:
##
@@ -106,6 +106,9 @@ impl ScalarUDFImpl for GetFieldFunc {
 };
 let access_schema = GetFieldAccessSchema::NamedStructField { name: 
name.clone() };
 let arg_dt = args[0].get_type(schema)?;
+if arg_dt.is_null() {
+return Ok(DataType::Null);
+}
 access_schema

Review Comment:
   I quickly fixed it before noticing that there was already a PR
   
   I think we can remove `GetFieldAccessSchema`, `get_accessed_field`. 
https://github.com/apache/datafusion/commit/6cb45b5a9f2b53688a9754b1a7d06665ebd73a6d



-- 
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-unsubscr...@datafusion.apache.org

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


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



Re: [PR] Fix `NULL["field"]` for expr_API [datafusion]

2024-05-24 Thread via GitHub


jayzhan211 commented on code in PR #10655:
URL: https://github.com/apache/datafusion/pull/10655#discussion_r1614200131


##
datafusion/functions/src/core/getfield.rs:
##
@@ -106,6 +106,9 @@ impl ScalarUDFImpl for GetFieldFunc {
 };
 let access_schema = GetFieldAccessSchema::NamedStructField { name: 
name.clone() };
 let arg_dt = args[0].get_type(schema)?;
+if arg_dt.is_null() {
+return Ok(DataType::Null);
+}
 access_schema

Review Comment:
   I quickly fixed it before noticing that there was already a PR
   
https://github.com/apache/datafusion/commit/6cb45b5a9f2b53688a9754b1a7d06665ebd73a6d
   
   I think we can remove `GetFieldAccessSchema`, `get_accessed_field`.



-- 
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-unsubscr...@datafusion.apache.org

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


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



Re: [PR] Fix `NULL["field"]` for expr_API [datafusion]

2024-05-24 Thread via GitHub


jayzhan211 commented on code in PR #10655:
URL: https://github.com/apache/datafusion/pull/10655#discussion_r1614200131


##
datafusion/functions/src/core/getfield.rs:
##
@@ -106,6 +106,9 @@ impl ScalarUDFImpl for GetFieldFunc {
 };
 let access_schema = GetFieldAccessSchema::NamedStructField { name: 
name.clone() };
 let arg_dt = args[0].get_type(schema)?;
+if arg_dt.is_null() {
+return Ok(DataType::Null);
+}
 access_schema

Review Comment:
   I quickly fixed it before noticing that there was already a PR
   
https://github.com/apache/datafusion/commit/82530608d6737c8d1906250dbe1aab6f426d47f4
   
   I think we can remove `GetFieldAccessSchema`, `get_accessed_field`.



-- 
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-unsubscr...@datafusion.apache.org

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


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