Description
var df = spark.sql("select element_at(array(3, 2, 1), 0)")
df.printSchema()
df = spark.sql("select element_at(array(3, 2, 1), 1)")
df.printSchema()
df = spark.sql("select element_at(array(3, 2, 1), 2)")
df.printSchema()
df = spark.sql("select element_at(array(3, 2, 1), 3)")
df.printSchema()
root
– element_at(array(3, 2, 1), 0): integer (nullable = false) |
root
– element_at(array(3, 2, 1), 1): integer (nullable = false) |
root
– element_at(array(3, 2, 1), 2): integer (nullable = false) |
root
– element_at(array(3, 2, 1), 3): integer (nullable = true) |
In this case, the nullable property in element_at with CreateArray statement is not correct.