Skip to content

Commit

Permalink
Made MyLabeledPoint into a Java Bean
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbradley committed Nov 2, 2014
1 parent 20630bc commit 6fddc1c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.spark.sql

import scala.beans.{BeanInfo, BeanProperty}

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.annotation.SQLUserDefinedType
import org.apache.spark.sql.catalyst.types.UserDefinedType
Expand All @@ -31,7 +33,10 @@ private[sql] class MyDenseVector(val data: Array[Double]) extends Serializable {
}
}

private[sql] case class MyLabeledPoint(label: Double, features: MyDenseVector)
@BeanInfo
private[sql] case class MyLabeledPoint(
@BeanProperty label: Double,
@BeanProperty features: MyDenseVector)

private[sql] class MyDenseVectorUDT extends UserDefinedType[MyDenseVector] {

Expand Down

0 comments on commit 6fddc1c

Please sign in to comment.