cloud-fan commented on code in PR #54546:
URL: https://github.com/apache/spark/pull/54546#discussion_r2867250802
##########
sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala:
##########
@@ -1470,4 +1470,19 @@ class StringFunctionsSuite extends QueryTest with
SharedSparkSession {
Seq(Row("abc", "def")))
}
}
+
+ test("SPARK-55747: GetArrayItem NPE on null array from split() with ANSI
enabled") {
+ // GetArrayItem.nullable was incorrectly computed as false when the array
type has
+ // containsNull=false (e.g., from StringSplit) but the array itself can be
null.
+ // This caused codegen to skip null checks, leading to NPE when calling
+ // array.numElements() on a null array during bounds checking.
+ withTable("t") {
+ sql("CREATE OR REPLACE TABLE t (s STRING) USING parquet")
Review Comment:
```suggestion
sql("CREATE TABLE t (s STRING) USING parquet")
```
--
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]