ZEPPELIN-1411. UDF with pyspark not working - object has no attribute 'parseDataType'

This commit is contained in:
Jeff Zhang 2016-09-06 10:26:05 +08:00
parent 3e863a67cc
commit 296c63fdf4

View file

@ -218,7 +218,10 @@ java_import(gateway.jvm, "scala.Tuple2")
jconf = intp.getSparkConf()
conf = SparkConf(_jvm = gateway.jvm, _jconf = jconf)
sc = SparkContext(jsc=jsc, gateway=gateway, conf=conf)
sqlc = SQLContext(sc, intp.getSQLContext())
if sparkVersion.isSpark2():
sqlc = SQLContext(sparkContext=sc, jsqlContext=intp.getSQLContext())
else:
sqlc = SQLContext(sparkContext=sc, sqlContext=intp.getSQLContext())
sqlContext = sqlc
if sparkVersion.isSpark2():