-
Notifications
You must be signed in to change notification settings - Fork 29.1k
SPARK-6225 [CORE] [SQL] [STREAMING] Resolve most build warnings, 1.3.0 edition #4950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,12 +199,12 @@ object MatrixFactorizationModel extends Loader[MatrixFactorizationModel] { | |
| assert(formatVersion == thisFormatVersion) | ||
| val rank = (metadata \ "rank").extract[Int] | ||
| val userFeatures = sqlContext.parquetFile(userPath(path)) | ||
| .map { case Row(id: Int, features: Seq[Double]) => | ||
| (id, features.toArray) | ||
| .map { case Row(id: Int, features: Seq[_]) => | ||
| (id, features.asInstanceOf[Seq[Double]].toArray) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strangely, this is how the scala compiler wanted it. It doesn't like matching on a type with generics, since they are erased.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think the only way to check the type is to check the schema or to do an inner match-case for the Seq.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can also use the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, I tried putting |
||
| } | ||
| val productFeatures = sqlContext.parquetFile(productPath(path)) | ||
| .map { case Row(id: Int, features: Seq[Double]) => | ||
| (id, features.toArray) | ||
| .map { case Row(id: Int, features: Seq[_]) => | ||
| (id, features.asInstanceOf[Seq[Double]].toArray) | ||
| } | ||
| new MatrixFactorizationModel(rank, userFeatures, productFeatures) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you're wondering: no this wasn't one of those things deprecated in Hadoop 2.x; this was deprecated in 1.0.4 even!