Github user kevinyu98 commented on the pull request:

    https://github.com/apache/spark/pull/10125#issuecomment-220237290
  
    @cloud-fan I tried, and it still fail. It didn't go through the 
createDataFrame you added in SparkSession. 
    It went with  this createDataFrame(data: java.util.List[_], beanClass: 
Class[_]): DataFrame 
    -> val rows = SQLContext.beansToRows(data.asScala.iterator, beanInfo, 
attrSeq)
    
    the beanToRows will create internal rows and it is from SQLContext. 
    
    Should we add RowEncoder into the beansToRows call or leave the code as it 
is ? Thanks.
    
    here is the trace
    
    scala.MatchError: 1234567 (of class java.math.BigInteger)
        at 
org.apache.spark.sql.catalyst.CatalystTypeConverters$DecimalConverter.toCatalystImpl(CatalystTypeConverters.scala:326)
        at 
org.apache.spark.sql.catalyst.CatalystTypeConverters$DecimalConverter.toCatalystImpl(CatalystTypeConverters.scala:323)
        at 
org.apache.spark.sql.catalyst.CatalystTypeConverters$CatalystTypeConverter.toCatalyst(CatalystTypeConverters.scala:102)
        at 
org.apache.spark.sql.catalyst.CatalystTypeConverters$$anonfun$createToCatalystConverter$2.apply(CatalystTypeConverters.scala:401)
        at 
org.apache.spark.sql.SQLContext$$anonfun$beansToRows$1$$anonfun$apply$1.apply(SQLContext.scala:892)
        at 
org.apache.spark.sql.SQLContext$$anonfun$beansToRows$1$$anonfun$apply$1.apply(SQLContext.scala:892)
        at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
        at 
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
        at 
scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
        at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
        at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:186)
        at 
org.apache.spark.sql.SQLContext$$anonfun$beansToRows$1.apply(SQLContext.scala:892)
        at 
org.apache.spark.sql.SQLContext$$anonfun$beansToRows$1.apply(SQLContext.scala:890)
        at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
        at scala.collection.Iterator$class.toStream(Iterator.scala:1322)
        at scala.collection.AbstractIterator.toStream(Iterator.scala:1336)
        at 
scala.collection.TraversableOnce$class.toSeq(TraversableOnce.scala:298)
        at scala.collection.AbstractIterator.toSeq(Iterator.scala:1336)
        at 
org.apache.spark.sql.SparkSession.createDataFrame(SparkSession.scala:373)
        at 
test.org.apache.spark.sql.JavaDataFrameSuite.testCreateDataFrameFromLocalJavaBeans(JavaDataFrameSuite.java:200)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to