GitHub user baishuo opened a pull request:

    https://github.com/apache/spark/pull/949

    fix java.lang.ClassCastException

    get Exception when run:bin/run-example 
org.apache.spark.examples.sql.RDDRelation
    Exception's detail is:
    Exception in thread "main" java.lang.ClassCastException: java.lang.Long 
cannot be cast to java.lang.Integer
        at scala.runtime.BoxesRunTime.unboxToInt(BoxesRunTime.java:106)
        at 
org.apache.spark.sql.catalyst.expressions.GenericRow.getInt(Row.scala:145)
        at org.apache.spark.examples.sql.RDDRelation$.main(RDDRelation.scala:49)
        at org.apache.spark.examples.sql.RDDRelation.main(RDDRelation.scala)
    change sql("SELECT COUNT(*) FROM records").collect().head.getInt(0) to 
sql("SELECT COUNT(*) FROM records").collect().head.getLong(0), then the 
Exception do not occur any more

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/baishuo/spark master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/949.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #949
    
----
commit f4b319f76760e02979813955dfbb5a8dc3a43ffd
Author: baishuo(白硕) <vc_j...@hotmail.com>
Date:   2014-06-03T10:32:00Z

    fix java.lang.ClassCastException
    
    get Exception when run:bin/run-example 
org.apache.spark.examples.sql.RDDRelation
    Exception's detail is:
    Exception in thread "main" java.lang.ClassCastException: java.lang.Long 
cannot be cast to java.lang.Integer
        at scala.runtime.BoxesRunTime.unboxToInt(BoxesRunTime.java:106)
        at 
org.apache.spark.sql.catalyst.expressions.GenericRow.getInt(Row.scala:145)
        at org.apache.spark.examples.sql.RDDRelation$.main(RDDRelation.scala:49)
        at org.apache.spark.examples.sql.RDDRelation.main(RDDRelation.scala)
    change sql("SELECT COUNT(*) FROM records").collect().head.getInt(0) to 
sql("SELECT COUNT(*) FROM records").collect().head.getLong(0), then the 
Exception do not occur any more

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to