1
この単純なPySparkスニペットは通常のspark-submitで正常に動作しますが、cast
呼び出しでApache Zeppelinで失敗します。何か案は?Zeppelin PySpark: 'JavaMember'オブジェクトに 'parseDataType'属性がありません
%pyspark
import pyspark.sql.functions as spark_functions
col1 = spark_functions.lit(None)
print("type(col1)={}".format(type(col1)))
col2 = col1.cast(StringType())
エラーがある:
Traceback (most recent call last):
File "/tmp/zeppelin_pyspark-6046223946582899049.py", line 252, in <module>
eval(compiledCode)
File "<string>", line 14, in <module>
File "/usr/lib/spark/python/pyspark/sql/column.py", line 334, in cast
jdt = ctx._ssql_ctx.parseDataType(dataType.json())
AttributeError: 'JavaMember' object has no attribute 'parseDataType'