When i display my spark df, i run into a SparkRuntimeException. I am unsure of what it means or what I need to fix.
file_path = "/Volumes/filepath/file.xlsx"
df = spark.read \
.format("com.crealytics.spark.excel") \
.option("header", "true") \
.option("inferSchema", "true") \
.load(file_path)
display(df)
The following is the error:
SparkRuntimeException: [EXPRESSION_ENCODING_FAILED] Failed to encode a value of the expressions: if (assertnotnull(input[0, org.apache.spark.sql.Row, true]).isNullAt) null else staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, validateexternaltype(getexternalrowfield(assertnotnull(input[0, org.apache.spark.sql.Row, true]), 0, Header1), StringType, ObjectType(class java.lang.String)), true, false, true) AS Header1#41651 to a row. SQLSTATE: 42846