Spark on Scala 2.11

2014-05-10 Thread Anand Avati
Is there an ongoing effort (or intent) to support Spark on Scala 2.11?
Approximate timeline?

Thanks


Using spark 1.0.0 assembly in IntelliJ

2014-05-10 Thread Usman Ghani
*(Includes solution)*

I was having this weird issue where when I use a Spark 0.9.1 or earlier Jar
file in IntelliJ I can see its contents and IntelliJ can work with it. But
when I compile version 1.0.0 from source my jar is not being recognized by
IntelliJ even though I can build my project using ant from the command
line.

*Snapshot attached.*

[image: Inline image 1]

Basically IntelliJ on Mac always uses Apple JDK 1.6 to run. You have to
manually change it to run under 1.7 so it can look inside a 1.7 jar
compiled to 1.7 byte code. In case you run into this, use this link to
change the JVM under which intelliJ runs.

https://intellij-support.jetbrains.com/entries/23455956-Selecting-the-JDK-version-the-IDE-will-run-under


LabeledPoint toString to dump LibSvm if SparseVector

2014-05-10 Thread Debasish Das
Hi,

I need to change the toString on LabeledPoint to libsvm format so that I
can dump RDD[LabeledPoint] as a format that could be read by sparse
glmnet-R and other packages to benchmark mllib classification accuracy...

Basically I have to change the toString of LabeledPoint and toString of
SparseVector

Should I add it as a PR or is it already being added ?

I added these functions toLibSvm in my internal util class for now...

def toLibSvm(labelPoint: LabeledPoint): String = {

labelPoint.label.toString +   + toLibSvm(labelPoint.features
.asInstanceOf[SparseVector])

  }

  def toLibSvm(features: SparseVector): String = {

val indices = features.indices

val values = features.values

indices.zip(values).mkString( ).replace(',', ':').replace((, 
).replace(),)

  }
Thanks.
Deb



On Fri, May 9, 2014 at 10:09 PM, mateiz g...@git.apache.org wrote:

 Github user mateiz commented on a diff in the pull request:

 https://github.com/apache/spark/pull/685#discussion_r12502569

 --- Diff:
 mllib/src/test/scala/org/apache/spark/mllib/linalg/VectorsSuite.scala ---
 @@ -100,4 +100,27 @@ class VectorsSuite extends FunSuite {
  assert(vec2(6) === 4.0)
  assert(vec2(7) === 0.0)
}
 +
 +  test(parse vectors) {
 +val vectors = Seq(
 +  Vectors.dense(Array.empty[Double]),
 +  Vectors.dense(1.0),
 +  Vectors.dense(1.0, 0.0, -2.0),
 +  Vectors.sparse(0, Array.empty[Int], Array.empty[Double]),
 +  Vectors.sparse(1, Array(0), Array(1.0)),
 +  Vectors.sparse(3, Array(0, 2), Array(1.0, -2.0)))
 +vectors.foreach { v =
 +  val v1 = Vectors.parse(v.toString)
 +  assert(v.getClass === v1.getClass)
 +  assert(v === v1)
 +}
 +
 +val malformatted = Seq(1, [1,,], [1,2, (1,[1,2]),
 (1,[1],[2.0,1.0]))
 +malformatted.foreach { s =
 +  intercept[RuntimeException] {
 --- End diff --

 Should be Exception instead


 ---
 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.
 ---



Re: Spark on Scala 2.11

2014-05-10 Thread Gary Malouf
Considering the team just bumped to 2.10 in 0.9, I would be surprised if
this is a near term priority.


On Thu, May 8, 2014 at 9:33 PM, Anand Avati av...@gluster.org wrote:

 Is there an ongoing effort (or intent) to support Spark on Scala 2.11?
 Approximate timeline?

 Thanks