【发布时间】:2019-10-15 23:40:39
【问题描述】:
df = spark.read.parquet('xxx')
tmstmp = df['timestamp']
spark.conf.set("spark.sql.session.timeZone", "Singapore")
time_df = spark.createDataFrame([('tmstmp',)], ['unix_time'])
time_df.select(from_unixtime('unix_time').alias('ts')).collect()
df['timestamp'] = time_df
spark.conf.unset("spark.sql.session.timeZone")
此行有错误:
time_df.select(from_unixtime('unix_time').alias('ts')).collect()
异常错误消息:
异常:worker 中的 Python 2.7 版本与驱动程序 3.7 中的版本不同,PySpark 无法使用不同的次要版本运行。请检查环境变量 PYSPARK_PYTHON 和 PYSPARK_DRIVER_PYTHON 是否设置正确。
【问题讨论】:
标签: pyspark jupyter pyspark-sql