xkrogen commented on code in PR #37634:
URL: https://github.com/apache/spark/pull/37634#discussion_r955182512


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -447,6 +447,13 @@ private[sql] object QueryExecutionErrors extends 
QueryErrorsBase {
     new RuntimeException(fieldCannotBeNullMsg(index, fieldName))
   }
 
+  def valueCannotBeNullError(locationDesc: String): RuntimeException = {
+    new RuntimeException(s"The value at $locationDesc cannot be null, but a 
NULL was found. " +
+      "This is typically caused by the presence of a NULL value when the 
schema indicates the " +
+      "value should be non-null. Check that the input data matches the schema 
and/or that UDFs " +

Review Comment:
   Yeah, it handles this situation. Marking a UDF as non-nullable just adjusts 
the schema, then the output row will contain a null value -- so the situation 
is identical to what is already tested in `GeneratedProjectionSuite`. But I can 
add this to `DataFrameSuite` to explicitly demonstrate that it is covered.



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