[ https://issues.apache.org/jira/browse/SPARK-3592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Armbrust resolved SPARK-3592. ------------------------------------- Resolution: Fixed Fix Version/s: 1.2.0 Issue resolved by pull request 2448 [https://github.com/apache/spark/pull/2448] > applySchema to an RDD of Row > ---------------------------- > > Key: SPARK-3592 > URL: https://issues.apache.org/jira/browse/SPARK-3592 > Project: Spark > Issue Type: Bug > Components: PySpark, SQL > Reporter: Davies Liu > Assignee: Davies Liu > Priority: Critical > Fix For: 1.2.0 > > > Right now, we can not appy schema to a RDD of Row, this should be a Bug, > {code} > >>> srdd = sqlCtx.jsonRDD(sc.parallelize(["""{"a":2}"""])) > >>> sqlCtx.applySchema(srdd.map(lambda x:x), srdd.schema()) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/Users/daviesliu/work/spark/python/pyspark/sql.py", line 1121, > in applySchema > _verify_type(row, schema) > File "/Users/daviesliu/work/spark/python/pyspark/sql.py", line 736, > in _verify_type > % (dataType, type(obj))) > TypeError: StructType(List(StructField(a,IntegerType,true))) can not > accept abject in type <class 'pyspark.sql.Row'> > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org